diff options
| author | Fabrice <fabrice@schaub-dev.xyz> | 2026-04-13 16:35:55 +0200 |
|---|---|---|
| committer | Fabrice <fabrice@schaub-dev.xyz> | 2026-04-13 16:35:55 +0200 |
| commit | b7210745c9d3920db5e09f3ebbe0f9cb7051311c (patch) | |
| tree | 7b89e33d80dfefa2f9bc118d4baa24e92ca3d50e /cheesemap.c | |
| parent | c1ce7a2fbd952acf28319ce6e758b4d211950872 (diff) | |
restructure code
Diffstat (limited to 'cheesemap.c')
| -rw-r--r-- | cheesemap.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/cheesemap.c b/cheesemap.c index 4f76714..e4e1140 100644 --- a/cheesemap.c +++ b/cheesemap.c @@ -7,6 +7,9 @@ #define CM_ATTR(...) __attribute__((__VA_ARGS__)) +#define cm_max(x, y) ((x) > (y) ? (x) : (y)) +#define cm_ispow2(x) ((x) != 0 && (((x) & ((x) - 1)) == 0)) + CM_ATTR(hot) static inline cm_usize cm_ctz(cm_usize val) { cm_assert(val != 0); #if UINTPTR_MAX == UINT64_MAX @@ -61,9 +64,6 @@ CM_ATTR(hot) static inline cm_usize cm_bitmask_clz(bitmask_t mask) { #endif } -#define cm_max(x, y) ((x) > (y) ? (x) : (y)) -#define cm_ispow2(x) ((x) != 0 && (((x) & ((x) - 1)) == 0)) - static inline cm_usize cm_align_up(cm_usize value, cm_usize alignment) { cm_assert(cm_ispow2(alignment)); return (value + alignment - 1) & ~(alignment - 1); @@ -339,7 +339,6 @@ static bool cm_raw_find(const struct cheesemap_raw* map, cm_compare_fn compare, // EMPTY terminates the probe chain: if the key were present, insertion // would have placed it before the first EMPTY slot in the sequence. if (cm_group_match_empty(group) != 0) return false; - cm_sequence_next(&seq, map->bucket_mask); } } |
