3 ms·
I disagree, lmdb is exactly what you need to run exactly where you want. No more, no less.
by malkia 3y ago
I disagree, lmdb is exactly what you need to run exactly where you want. No more, no less.
- kazinator 3y agoEvery flag you don't use is more than what you need or want and could be a compile-time configuration option to remove the associated code which implements the flag. Functions represented as integer codes that go through a common dispatch function similar to ioctl lead to compiled code from which the linker cannot remove unused functions. If instead of a MDB_GET_BOTH_RANGE opcode to mdb_cursor_get there was a mdb_cursor_get_both_range function, then if you don't use that function, it could be removed out of the executable. (If it's put into its own object file, and the database library is statically linked.)
- malkia 3y agoOh, please let's not this go into another "compile time" flag, because I've seen enough where this goes. Unless you are doing strictly embedded, or whatever clearance software, you don't need this "compile time" thing. (I'm speaking from experience, having and still having to deal with tons of #ifdef code - gamedev, great for shipping to a console, awful for the rest of the code - game tools).
- deleted 3y ago[deleted]
- kazinator 3y agoYou can have it both ways! #ifdef FOO_BUILD_TIME_FLAGS #define foo_enabled(CTX, FLAG) ((FOO_BUILD_TIME_FLAGS & (FLAG)) != 0) #else #define foo_enabled(CTX, FLAG) (((CTX)->flags & (FLAG)) != 0) #endif If we specify FOO_BUILD_TIME_FLAGS symbol which expands to a bitwise OR or various flags (or maybe just zero!) then the flag checks in the code all become constant expressions, subject to dead code elimination. If we don't specify that, then there is a flags field that is checked at run-time. I'd rather have most of the flags go away. Pick a behavior and hard-coded. Those who want it some other way can UTSL: use the source, Luke. If you have 8 flags, that's 256 combinations to test for interactions.