Skip to content
Discussion options

You must be logged in to vote

For a local build, no problem as far as I can see. The 9 bits only live in the AttributePair bitfield. Everywhere else (key2index, getKey, the Lua attribute calls, the rank table) carries the key index as a uint16_t, so the rest of the code already handles up to 65,535.

Three spots to change for 12 bits:

  1. include/attribute_store.h: unsigned short keyIndex : 12;
  2. src/attribute_store.cpp, in AttributeKeyStore::key2index: if (newIndex >= 512) becomes if (newIndex >= 4096), plus the message.
  3. test/attribute_store.test.cpp around line 120 expects the throw at the 512th key, so update that test or it fails.

The cost is memory. AttributePair is under #pragma pack(push, 1), and the three bitfields…

Replies: 1 comment 9 replies

Comment options

You must be logged in to vote
9 replies
@etienneJr
Comment options

@dylanpulver
Comment options

Answer selected by etienneJr
@dktue
Comment options

@dylanpulver
Comment options

@dktue
Comment options

@etienneJr
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants