// If a key is a prefix of another key, such a key is associated with a special // terminal node which has TERMINAL_LABEL. const UInt16 TERMINAL_LABEL = 0x100; const UInt16 MIN_LABEL = '\0'; const UInt16 MAX_LABEL = TERMINAL_LABEL; const UInt32 INVALID_LABEL = 0x1FF; const UInt32 LABEL_MASK = 0x1FF;
// The MSB of BASE is used to represent whether the node is a linker node or // not and the other 31 bits represent the offset to its child nodes. So, the // number of nodes is limited to 2^31. const UInt32 ROOT_NODE_ID = 0; const UInt32 MAX_NODE_ID = 0x7FFFFFFF; const UInt32 MAX_NUM_NODES = MAX_NODE_ID + 1; const UInt32 INVALID_NODE_ID = MAX_NODE_ID + 1;
// 0 is reserved for non-linker leaf nodes. For example, the root node of an // initial double-array is a non-linker leaf node. const UInt32 MAX_OFFSET = MAX_NODE_ID; const UInt32 INVALID_OFFSET = 0;
// Phantom nodes are managed in each block because siblings are always put in // the same block. const UInt32 BLOCK_SIZE = 0x200; const UInt32 BLOCK_MASK = 0x1FF; const UInt32 MAX_BLOCK_ID = MAX_NODE_ID / BLOCK_SIZE; const UInt32 MAX_NUM_BLOCKS = MAX_BLOCK_ID + 1;
// Blocks are divided by their levels, which indicate how easily update // operations can find a good offset in them. The level of a block rises when // find_offset() fails in that block many times. MAX_FAILURE_COUNT is the // threshold. Also, in order to limit the time cost, find_offset() scans at // most MAX_BLOCK_COUNT blocks. // Larger parameters bring more chances of finding good offsets but it leads to // more node renumberings, which are costly operations, and thus results in // a degradation of space/time efficiencies. const UInt32 MAX_FAILURE_COUNT = 4; const UInt32 MAX_BLOCK_COUNT = 16; const UInt32 MAX_BLOCK_LEVEL = 5;
// Blocks in the same level compose a doubly linked list. The entry block of // a linked list is called a leader. INVALID_LEADER means that a linked list is // empty and there exists no leader. const UInt32 INVALID_LEADER = 0x7FFFFFFF;
// A key length is represented as a 12-bit unsigned integer in Key. // A key ID is represented as a 28-bit unsigned integer in Key. const UInt32 MAX_KEY_LENGTH = (1U << 12) - 1; const UInt32 MAX_NUM_KEYS = (1U << 28) - 1;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.