diff options
| author | Fabrice <fabrice@schaub-dev.xyz> | 2026-04-12 21:42:26 +0200 |
|---|---|---|
| committer | Fabrice <fabrice@schaub-dev.xyz> | 2026-04-12 21:42:26 +0200 |
| commit | 1e808c9effe61b3d1188efb7180965f623a66579 (patch) | |
| tree | 78f416b8417bb99e7a938e26e692c51f5103d721 /cheesemap.c | |
| parent | 0df03d19ce07e6104008e55e4adef101e954071b (diff) | |
move the layout method and dont inline
Diffstat (limited to 'cheesemap.c')
| -rw-r--r-- | cheesemap.c | 35 |
1 files changed, 17 insertions, 18 deletions
diff --git a/cheesemap.c b/cheesemap.c index ef98dc8..1b34f6c 100644 --- a/cheesemap.c +++ b/cheesemap.c @@ -204,24 +204,6 @@ static inline cm_usize cm_ctrl_offset(cm_usize buckets, return cm_align_up(offset, ctrl_align); } -static inline void cm_raw_layout(const struct cm_type* type, cm_usize capacity, - cm_usize* out_buckets, - cm_usize* out_ctrl_offset, - cm_usize* out_size) { - cm_assert(type != NULL && out_buckets != NULL); - cm_assert(out_ctrl_offset != NULL && out_size != NULL); - - cm_usize buckets = cm_capacity_to_buckets(capacity); - cm_usize ctrl_offset = cm_ctrl_offset(buckets, type); - - cm_usize size = ctrl_offset + buckets + CM_GROUP_SIZE; - size = cm_align_up(size, cm_alloc_align(type)); - - *out_buckets = buckets; - *out_ctrl_offset = ctrl_offset; - *out_size = size; -} - static inline cm_u8* cm_raw_elem_at(const struct cheesemap_raw* map, cm_usize index, const struct cm_type* type) { @@ -249,6 +231,23 @@ static inline void cm_raw_ctrl_set(struct cheesemap_raw* map, cm_usize index, map->ctrl[index2] = ctrl; } +static void cm_raw_layout(const struct cm_type* type, cm_usize capacity, + cm_usize* out_buckets, cm_usize* out_ctrl_offset, + cm_usize* out_size) { + cm_assert(type != NULL && out_buckets != NULL); + cm_assert(out_ctrl_offset != NULL && out_size != NULL); + + cm_usize buckets = cm_capacity_to_buckets(capacity); + cm_usize ctrl_offset = cm_ctrl_offset(buckets, type); + + cm_usize size = ctrl_offset + buckets + CM_GROUP_SIZE; + size = cm_align_up(size, cm_alloc_align(type)); + + *out_buckets = buckets; + *out_ctrl_offset = ctrl_offset; + *out_size = size; +} + static bool cm_raw_find_insert_index_in_group(const struct cheesemap_raw* map, const group_t* group, const struct sequence* seq, |
