

Go to the source code of this file.
Classes | |
| struct | tommy_node_struct |
Macros | |
| #define | tommy_cast(type, value) |
| #define | tommy_malloc malloc |
| #define | tommy_calloc calloc |
| #define | tommy_realloc realloc |
| #define | tommy_free free |
| #define | tommy_inline static |
| #define | tommy_restrict |
| #define | tommy_likely(x) |
| #define | tommy_unlikely(x) |
| #define | TOMMY_KEY_BIT (sizeof(tommy_key_t) * 8) |
| #define | TOMMY_ILOG2(value) |
Typedefs | |
| typedef struct tommy_node_struct | tommy_node |
Functions | |
| tommy_inline tommy_uint_t | tommy_ilog2_u32 (tommy_uint32_t value) |
| tommy_inline tommy_uint_t | tommy_ctz_u32 (tommy_uint32_t value) |
| tommy_inline tommy_uint32_t | tommy_roundup_pow2_u32 (tommy_uint32_t value) |
Generic types.
Definition in file tommytypes.h.
| #define tommy_calloc calloc |
Definition at line 96 of file tommytypes.h.
| #define tommy_cast | ( | type, | |
| value ) |
Definition at line 77 of file tommytypes.h.
| #define tommy_free free |
Definition at line 102 of file tommytypes.h.
| #define TOMMY_ILOG2 | ( | value | ) |
Definition at line 306 of file tommytypes.h.
| #define tommy_inline static |
Definition at line 115 of file tommytypes.h.
| #define TOMMY_KEY_BIT (sizeof(tommy_key_t) * 8) |
Bits into the tommy_key_t type.
Definition at line 165 of file tommytypes.h.
| #define tommy_likely | ( | x | ) |
Definition at line 139 of file tommytypes.h.
| #define tommy_malloc malloc |
Generic malloc(), calloc(), realloc() and free() functions. Redefine them to what you need. By default they map to the C malloc(), calloc(), realloc() and free().
Definition at line 93 of file tommytypes.h.
| #define tommy_realloc realloc |
Definition at line 99 of file tommytypes.h.
| #define tommy_restrict |
Definition at line 128 of file tommytypes.h.
| #define tommy_unlikely | ( | x | ) |
Definition at line 150 of file tommytypes.h.
| typedef struct tommy_node_struct tommy_node |
Data structure node. This node type is shared between all the data structures and used to store some info directly into the objects you want to store.
A typical declaration is:
| tommy_inline tommy_uint_t tommy_ctz_u32 | ( | tommy_uint32_t | value | ) |
Bit scan forward or trailing zero count. Return the bit index of the least significant 1 bit.
If no bit is set, the result is undefined.
| value | Value to scan. 0 is not allowed. |
Definition at line 369 of file tommytypes.h.
| tommy_inline tommy_uint_t tommy_ilog2_u32 | ( | tommy_uint32_t | value | ) |
Bit scan reverse or integer log2. Return the bit index of the most significant 1 bit.
If no bit is set, the result is undefined. To force a return 0 in this case, you can use tommy_ilog2_u32(value | 1).
Other interesting ways for bitscan are at:
Bit Twiddling Hacks http://graphics.stanford.edu/~seander/bithacks.html
Chess Programming BitScan http://chessprogramming.wikispaces.com/BitScan
| value | Value to scan. 0 is not allowed. |
Definition at line 326 of file tommytypes.h.
| tommy_inline tommy_uint32_t tommy_roundup_pow2_u32 | ( | tommy_uint32_t | value | ) |
Rounds up to the next power of 2. For the value 0, the result is undefined.
Definition at line 394 of file tommytypes.h.