Libelektra: Remove Unused KeySet Flag

Created on 16 Dec 2017  路  7Comments  路  Source: ElektraInitiative/libelektra

During the integration of the OPMPHM I found a unused flag, it shall be removed!

  • [ ] KS_FLAG_SYNC in kdbprivate.h:136 and
  • [ ] the function int ksNeedSync (const KeySet * ks).

Nevermind the conversation :)

@markus2330 I told you that I need a Flag but I found another way. Whats about the second one? It also dose some weird stuff.
@mpranj could you use the first one?

cleanup question

Most helpful comment

In that case I can reuse/rename it instead of my additional flag.

All 7 comments

I'm not sure what you mean. I haven't used KS_FLAG_SYNC for anything. I had to introduce KS_FLAG_MMAP and KEY_FLAG_MMAP so I can track what's inside a mmap region (and therefore should not be free()'d).

Yes, one information is about who allocated the memory, the other information (@KurtMi is interested in) is about if there were changes in the KeySet.

@KurtMi Please reuse the unused KS_FLAG_SYNC (or rename it if you do not like the name). But we should definitely get rid of obsolete/historical stuff.

@markus2330 I apologize for causing confusion! The point is that I do NOT need the KS_FLAG_SYNC flag and I thought @mpranj could use it. But since nobody has usage for that flag, this issue will be transformed into the task to remove the flag.

In that case I can reuse/rename it instead of my additional flag.

I found out that removing that flag appears to be non trivial since the function ksNeedSync (...), that reads out that flag is also present in the bindings:

src/bindings/haskell/src/Elektra/KeySet.chs:12:  ksGetSize, ksNeedSync,
src/bindings/haskell/src/Elektra/KeySet.chs:55:{#fun unsafe ksNeedSync {`KeySet'} -> `Int' #}
src/bindings/jna/libelektra4j/src/main/java/org/libelektra/Elektra.java:143:    int ksNeedSync(Pointer ks);
src/bindings/jna/libelektra4j/src/main/java/org/libelektra/KeySet.java:175:             return Elektra.INSTANCE.ksNeedSync(get());

Yes, additionally it would be an ABI/API break in the core library. So it needs to wait to 1.0 anyway.

doc/todo/FUTURE already lists ksNeedSync to be removed.

But: always returning true/false (like it was before) should be fine, too. Then we could remove the flag, and only keep the ksNeedSync

I mark this issue stale as it did not have any activity for one year. I'll close it in two weeks if no further activity occurs. If you want it to be alive again, ping the issue by writing a message here or create a new issue with the remainder of this issue.
Thank you for your contributions :sparkling_heart:

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sanssecours picture sanssecours  路  4Comments

mpranj picture mpranj  路  3Comments

markus2330 picture markus2330  路  3Comments

sanssecours picture sanssecours  路  4Comments

markus2330 picture markus2330  路  4Comments