From 1e808c9effe61b3d1188efb7180965f623a66579 Mon Sep 17 00:00:00 2001 From: Fabrice Date: Sun, 12 Apr 2026 21:42:26 +0200 Subject: move the layout method and dont inline --- cheesemap.c | 35 +++++++++++++++++------------------ 1 file 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, -- cgit v1.2.3