From 0e34021bdbd6d85187cae6550dc8fb73eec6e8c9 Mon Sep 17 00:00:00 2001 From: Antonin Reitz Date: Mon, 2 Sep 2024 04:08:22 +0200 Subject: [PATCH] refresh dist/ --- dist/ArrayList.c | 18 +- dist/Config.c | 14 +- dist/Config.h | 14 +- dist/Constants.c | 4 +- dist/PtrdiffWrapper.c | 2 +- dist/Slabs.c | 100 +- dist/Slabs2.c | 64 +- dist/StarMalloc.c | 1997 +++++++++++++++++++----------------- dist/StarMalloc.h | 1 + dist/internal/Slabs2.h | 6 - dist/internal/StarMalloc.h | 5 - dist/krmlinit.c | 7 +- dist/krmlinit.h | 1 + 13 files changed, 1181 insertions(+), 1052 deletions(-) diff --git a/dist/ArrayList.c b/dist/ArrayList.c index ba03a530..88e44e88 100644 --- a/dist/ArrayList.c +++ b/dist/ArrayList.c @@ -12,13 +12,13 @@ uint32_t ArrayList_read_in_place(ArrayList_cell *r, size_t idx) size_t ArrayList_remove(ArrayList_cell *r, size_t hd1, size_t idx) { ArrayList_cell cell1 = r[idx]; - if (cell1.next != 16777217U) + if (cell1.next != (size_t)16777217U) { ArrayList_cell next = r[cell1.next]; ArrayList_cell next1 = { .prev = cell1.prev, .next = next.next, .data = next.data }; r[cell1.next] = next1; } - if (cell1.prev != 16777217U) + if (cell1.prev != (size_t)16777217U) { ArrayList_cell prev = r[cell1.prev]; ArrayList_cell prev1 = { .prev = prev.prev, .next = cell1.next, .data = prev.data }; @@ -32,9 +32,9 @@ size_t ArrayList_remove(ArrayList_cell *r, size_t hd1, size_t idx) void ArrayList_insert(ArrayList_cell *r, size_t hd, size_t idx, uint32_t v) { - ArrayList_cell cell1 = { .prev = 16777217U, .next = hd, .data = v }; + ArrayList_cell cell1 = { .prev = (size_t)16777217U, .next = hd, .data = v }; r[idx] = cell1; - if (hd != 16777217U) + if (hd != (size_t)16777217U) { ArrayList_cell cell2 = r[hd]; ArrayList_cell cell3 = { .prev = idx, .next = cell2.next, .data = cell2.data }; @@ -44,14 +44,14 @@ void ArrayList_insert(ArrayList_cell *r, size_t hd, size_t idx, uint32_t v) static void extend_insert__uint32_t(size_t n2, ArrayList_cell *r, size_t k, uint32_t v1) { - for (size_t i = 0U; i < n2; i++) + for (size_t i = (size_t)0U; i < n2; i++) { - ArrayList_cell cell1 = { .prev = 16777217U, .next = k + i, .data = v1 }; - r[k + i + 1U] = cell1; - if (k + i != 16777217U) + ArrayList_cell cell1 = { .prev = (size_t)16777217U, .next = k + i, .data = v1 }; + r[k + i + (size_t)1U] = cell1; + if (k + i != (size_t)16777217U) { ArrayList_cell cell2 = r[k + i]; - ArrayList_cell cell3 = { .prev = k + i + 1U, .next = cell2.next, .data = cell2.data }; + ArrayList_cell cell3 = { .prev = k + i + (size_t)1U, .next = cell2.next, .data = cell2.data }; r[k + i] = cell3; } } diff --git a/dist/Config.c b/dist/Config.c index 6aa2ebce..51938762 100644 --- a/dist/Config.c +++ b/dist/Config.c @@ -7,11 +7,17 @@ bool Config_enable_extended_size_classes = true; bool Config_enable_sc_fast_selection = true; -size_t Config_metadata_max = 16777216U; +size_t Config_metadata_max = (size_t)16777216U; + +size_t Config_sc_slab_region_size = (size_t)68719476736U; + +size_t Config_full_slab_region_size = (size_t)8796093022208U; + +size_t Config_metadata_max_ex = (size_t)262144U; bool Config_enable_guard_pages = true; -size_t Config_guard_pages_interval = 2U; +size_t Config_guard_pages_interval = (size_t)2U; bool Config_enable_quarantine = true; @@ -19,9 +25,9 @@ bool Config_enable_quarantine_trap = true; bool Config_enable_quarantine_strict_trap = false; -size_t Config_quarantine_queue_length = 1024U; +size_t Config_quarantine_queue_length = (size_t)1024U; -size_t Config_quarantine_queue_threshold = 256U; +size_t Config_quarantine_queue_threshold = (size_t)256U; bool Config_enable_zeroing_malloc = true; diff --git a/dist/Config.h b/dist/Config.h index 4a7ae7c4..e48a68c7 100644 --- a/dist/Config.h +++ b/dist/Config.h @@ -6,20 +6,26 @@ #include "krmllib.h" -#define CONFIG_NB_SIZE_CLASSES (32U) +#define CONFIG_NB_SIZE_CLASSES ((size_t)32U) -#define CONFIG_NB_SIZE_CLASSES_SC (27U) +#define CONFIG_NB_SIZE_CLASSES_SC ((size_t)27U) -#define CONFIG_NB_SIZE_CLASSES_SC_EX (5U) +#define CONFIG_NB_SIZE_CLASSES_SC_EX ((size_t)5U) extern bool Config_enable_extended_size_classes; extern bool Config_enable_sc_fast_selection; -#define CONFIG_NB_ARENAS (4U) +#define CONFIG_NB_ARENAS ((size_t)4U) extern size_t Config_metadata_max; +extern size_t Config_sc_slab_region_size; + +extern size_t Config_full_slab_region_size; + +extern size_t Config_metadata_max_ex; + extern bool Config_enable_guard_pages; extern size_t Config_guard_pages_interval; diff --git a/dist/Constants.c b/dist/Constants.c index e3a8add8..b4e57d0c 100644 --- a/dist/Constants.c +++ b/dist/Constants.c @@ -5,9 +5,9 @@ uint32_t Constants_page_size = 4096U; -size_t Constants_max_sc_coef = 32U; +size_t Constants_max_sc_coef = (size_t)32U; -size_t Constants_sc_ex_slab_size = (size_t)4096U * 64U; +size_t Constants_sc_ex_slab_size = (size_t)4096U * (size_t)64U; bool Constants_uu___is_Sc(Constants_sc_union projectee) { diff --git a/dist/PtrdiffWrapper.c b/dist/PtrdiffWrapper.c index c5549bec..389dbb3a 100644 --- a/dist/PtrdiffWrapper.c +++ b/dist/PtrdiffWrapper.c @@ -6,7 +6,7 @@ size_t PtrdiffWrapper_mmap_actual_size(size_t size) { size_t rem = size % (size_t)4096U; - if (rem != 0U) + if (rem != (size_t)0U) return size - rem + (size_t)4096U; else return size; diff --git a/dist/Slabs.c b/dist/Slabs.c index 1c14186f..6fa40035 100644 --- a/dist/Slabs.c +++ b/dist/Slabs.c @@ -25,14 +25,14 @@ update_quarantine2_aux( ) { ArrayList_cell cell = md_region[idx6]; - if (cell.next != 16777217U) + if (cell.next != (size_t)16777217U) { ArrayList_cell next = md_region[cell.next]; ArrayList_cell next1 = { .prev = cell.prev, .next = next.next, .data = next.data }; md_region[cell.next] = next1; } size_t tl_ = cell.prev; - if (cell.prev != 16777217U) + if (cell.prev != (size_t)16777217U) { ArrayList_cell prev = md_region[cell.prev]; ArrayList_cell prev1 = { .prev = prev.prev, .next = cell.next, .data = prev.data }; @@ -43,7 +43,7 @@ update_quarantine2_aux( hd_ = cell.next; else hd_ = idx5; - size_t sz_ = idx7 - 1U; + size_t sz_ = idx7 - (size_t)1U; ArrayListGen_tuple3 idxs = { .x = hd_, .y = tl_, .z = sz_ }; ArrayList_insert(md_region, idx1, idx6, 0U); return ((tuple4){ .x = idx6, .y = idxs.x, .z = idxs.y, .w = idxs.z }); @@ -58,7 +58,7 @@ update_quarantine2( size_t idx7 ) { - if (idx7 < 1024U) + if (idx7 < (size_t)1024U) return ((tuple4){ .x = idx1, .y = idx5, .z = idx6, .w = idx7 }); else { @@ -78,7 +78,7 @@ static void update_quarantine3_aux(uint8_t *slab_region, tuple4 idxs) static void update_quarantine3(uint8_t *slab_region, size_t idx7, tuple4 idxs) { - if (!(idx7 < 1024U)) + if (!(idx7 < (size_t)1024U)) update_quarantine3_aux(slab_region, idxs); } @@ -109,7 +109,7 @@ SlabsFree_deallocate_slab( if (status1 == 2U) { uint64_t *ptr10 = md_bm_region; - size_t shift_size_t0 = pos * 4U; + size_t shift_size_t0 = pos * (size_t)4U; uint8_t *ptr11 = slab_region; size_t page_size_t0 = (size_t)4096U; size_t shift_size_t1 = pos * page_size_t0; @@ -123,7 +123,7 @@ SlabsFree_deallocate_slab( if (b) { uint64_t *ptr1 = md_bm_region; - size_t shift_size_t = pos * 4U; + size_t shift_size_t = pos * (size_t)4U; bool r1 = Utils2_is_empty_s(size_class, ptr1 + shift_size_t); bool cond = r1; if (cond) @@ -135,20 +135,20 @@ SlabsFree_deallocate_slab( tuple4 idxs = update_quarantine2(md_region, idx1_, idx5_, idx6_, idx7_); size_t v = ArrayList_remove(md_region, idx3_, pos); size_t idx3_ = v; - ArrayList_cell cell = { .prev = 16777217U, .next = idxs.y, .data = 4U }; + ArrayList_cell cell = { .prev = (size_t)16777217U, .next = idxs.y, .data = 4U }; md_region[pos] = cell; - if (idxs.y != 16777217U) + if (idxs.y != (size_t)16777217U) { ArrayList_cell cell1 = md_region[idxs.y]; ArrayList_cell cell2 = { .prev = pos, .next = cell1.next, .data = cell1.data }; md_region[idxs.y] = cell2; } size_t tl_; - if (idxs.y == 16777217U) + if (idxs.y == (size_t)16777217U) tl_ = pos; else tl_ = idxs.z; - size_t sz_ = idxs.w + 1U; + size_t sz_ = idxs.w + (size_t)1U; ArrayListGen_tuple2 idxs_ = { .x1 = tl_, .y1 = sz_ }; update_quarantine3(slab_region, idx7_, idxs); r_idxs[0U] = idxs.x; @@ -174,7 +174,7 @@ SlabsFree_deallocate_slab( else if (status1 == 1U) { uint64_t *ptr10 = md_bm_region; - size_t shift_size_t0 = pos * 4U; + size_t shift_size_t0 = pos * (size_t)4U; uint8_t *ptr11 = slab_region; size_t page_size_t0 = (size_t)4096U; size_t shift_size_t1 = pos * page_size_t0; @@ -188,7 +188,7 @@ SlabsFree_deallocate_slab( if (b) { uint64_t *ptr1 = md_bm_region; - size_t shift_size_t = pos * 4U; + size_t shift_size_t = pos * (size_t)4U; bool r1 = Utils2_is_empty_s(size_class, ptr1 + shift_size_t); bool cond = r1; if (cond) @@ -200,20 +200,20 @@ SlabsFree_deallocate_slab( tuple4 idxs = update_quarantine2(md_region, idx1_, idx5_, idx6_, idx7_); size_t v = ArrayList_remove(md_region, idx2_, pos); size_t idx2_ = v; - ArrayList_cell cell = { .prev = 16777217U, .next = idxs.y, .data = 4U }; + ArrayList_cell cell = { .prev = (size_t)16777217U, .next = idxs.y, .data = 4U }; md_region[pos] = cell; - if (idxs.y != 16777217U) + if (idxs.y != (size_t)16777217U) { ArrayList_cell cell1 = md_region[idxs.y]; ArrayList_cell cell2 = { .prev = pos, .next = cell1.next, .data = cell1.data }; md_region[idxs.y] = cell2; } size_t tl_; - if (idxs.y == 16777217U) + if (idxs.y == (size_t)16777217U) tl_ = pos; else tl_ = idxs.z; - size_t sz_ = idxs.w + 1U; + size_t sz_ = idxs.w + (size_t)1U; ArrayListGen_tuple2 idxs_ = { .x1 = tl_, .y1 = sz_ }; update_quarantine3(slab_region, idx7_, idxs); r_idxs[0U] = idxs.x; @@ -240,7 +240,7 @@ static void allocate_slab_aux_3_3_2_2(uint8_t *slab_region, size_t md_count_v) { uint8_t *ptr = slab_region; size_t page_size_t = (size_t)4096U; - size_t shift_size_t = (md_count_v + 1U) * page_size_t; + size_t shift_size_t = (md_count_v + (size_t)1U) * page_size_t; mmap_strict_trap(ptr + shift_size_t, (size_t)4096U); } @@ -273,14 +273,14 @@ allocate_slab_aux_4_aux1( ) { ArrayList_cell cell = md_region[idx6]; - if (cell.next != 16777217U) + if (cell.next != (size_t)16777217U) { ArrayList_cell next = md_region[cell.next]; ArrayList_cell next1 = { .prev = cell.prev, .next = next.next, .data = next.data }; md_region[cell.next] = next1; } size_t tl_ = cell.prev; - if (cell.prev != 16777217U) + if (cell.prev != (size_t)16777217U) { ArrayList_cell prev = md_region[cell.prev]; ArrayList_cell prev1 = { .prev = prev.prev, .next = cell.next, .data = prev.data }; @@ -291,7 +291,7 @@ allocate_slab_aux_4_aux1( hd_ = cell.next; else hd_ = idx5; - size_t sz_ = idx7 - 1U; + size_t sz_ = idx7 - (size_t)1U; ArrayListGen_tuple3 idxs = { .x = hd_, .y = tl_, .z = sz_ }; ArrayList_insert(md_region, idx1, idx6, 0U); return ((bounded_tuple_){ .x = idx6, .y = idxs.x, .z = idxs.y, .w = idxs.z }); @@ -343,16 +343,16 @@ uint8_t size_t idx5_ = r_idxs[4U]; size_t idx6_ = r_idxs[5U]; size_t idx7_ = r_idxs[6U]; - if (idx2_ != 16777217U) + if (idx2_ != (size_t)16777217U) { uint64_t *ptr0 = md_bm_region; - size_t shift_size_t0 = idx2_ * 4U; + size_t shift_size_t0 = idx2_ * (size_t)4U; uint8_t *ptr1 = slab_region; size_t page_size_t = (size_t)4096U; size_t shift_size_t1 = idx2_ * page_size_t; uint8_t *r = SlotsAlloc_allocate_slot(size_class, ptr0 + shift_size_t0, ptr1 + shift_size_t1); uint64_t *ptr = md_bm_region; - size_t shift_size_t = idx2_ * 4U; + size_t shift_size_t = idx2_ * (size_t)4U; bool r1 = Utils2_is_full_s(size_class, ptr + shift_size_t); bool cond = r1; if (cond) @@ -366,16 +366,16 @@ uint8_t uint8_t *r0 = r; return r0; } - else if (idx1_ != 16777217U) + else if (idx1_ != (size_t)16777217U) { uint64_t *ptr0 = md_bm_region; - size_t shift_size_t0 = idx1_ * 4U; + size_t shift_size_t0 = idx1_ * (size_t)4U; uint8_t *ptr1 = slab_region; size_t page_size_t = (size_t)4096U; size_t shift_size_t1 = idx1_ * page_size_t; uint8_t *r = SlotsAlloc_allocate_slot(size_class, ptr0 + shift_size_t0, ptr1 + shift_size_t1); uint64_t *ptr = md_bm_region; - size_t shift_size_t = idx1_ * 4U; + size_t shift_size_t = idx1_ * (size_t)4U; bool r1 = Utils2_is_full_s(size_class, ptr + shift_size_t); bool cond = r1; if (cond) @@ -397,19 +397,19 @@ uint8_t } else { - bool b = idx7_ >= 256U; + bool b = idx7_ >= (size_t)256U; if (b) { bounded_tuple_ idxs = allocate_slab_aux_4(slab_region, md_region, r_idxs, idx1_, idx5_, idx6_, idx7_); uint64_t *ptr0 = md_bm_region; - size_t shift_size_t0 = idxs.x * 4U; + size_t shift_size_t0 = idxs.x * (size_t)4U; uint8_t *ptr1 = slab_region; size_t page_size_t = (size_t)4096U; size_t shift_size_t1 = idxs.x * page_size_t; uint8_t *r = SlotsAlloc_allocate_slot(size_class, ptr0 + shift_size_t0, ptr1 + shift_size_t1); uint64_t *ptr = md_bm_region; - size_t shift_size_t = idxs.x * 4U; + size_t shift_size_t = idxs.x * (size_t)4U; bool r1 = Utils2_is_full_s(size_class, ptr + shift_size_t); bool cond = r1; if (cond) @@ -432,12 +432,12 @@ uint8_t else { size_t md_count_v_0 = *md_count; - bool b1 = md_count_v_0 + 2U <= 16777216U; + bool b1 = md_count_v_0 + (size_t)2U <= (size_t)16777216U; if (b1) { ArrayList_insert(md_region, idx1_, md_count_v_, 0U); - ArrayList_extend_insert(2U, - 0U, + ArrayList_extend_insert((size_t)2U, + (size_t)0U, md_region, idx2_, idx3_, @@ -447,37 +447,45 @@ uint8_t idx7_, md_count_v_, 0U); - ArrayList_insert(md_region, idx4_, md_count_v_ + 2U - 1U, 3U); + ArrayList_insert(md_region, idx4_, md_count_v_ + (size_t)2U - (size_t)1U, 3U); allocate_slab_aux_3_3(slab_region, md_count_v_); size_t v = *md_count; - *md_count = v + 2U; - r_idxs[0U] = v + 2U - 2U; - r_idxs[3U] = v + 2U - 1U; + *md_count = v + (size_t)2U; + r_idxs[0U] = v + (size_t)2U - (size_t)2U; + r_idxs[3U] = v + (size_t)2U - (size_t)1U; uint64_t *ptr0 = md_bm_region; - size_t shift_size_t0 = (md_count_v_ + 2U - 2U) * 4U; + size_t shift_size_t0 = (md_count_v_ + (size_t)2U - (size_t)2U) * (size_t)4U; uint8_t *ptr1 = slab_region; size_t page_size_t = (size_t)4096U; - size_t shift_size_t1 = (md_count_v_ + 2U - 2U) * page_size_t; + size_t shift_size_t1 = (md_count_v_ + (size_t)2U - (size_t)2U) * page_size_t; uint8_t *r = SlotsAlloc_allocate_slot(size_class, ptr0 + shift_size_t0, ptr1 + shift_size_t1); uint64_t *ptr = md_bm_region; - size_t shift_size_t = (md_count_v_ + 2U - 2U) * 4U; + size_t shift_size_t = (md_count_v_ + (size_t)2U - (size_t)2U) * (size_t)4U; bool r1 = Utils2_is_full_s(size_class, ptr + shift_size_t); bool cond = r1; if (cond) { - size_t idx1_ = ArrayList_remove(md_region, md_count_v_ + 2U - 2U, md_count_v_ + 2U - 2U); - ArrayList_insert(md_region, idx3_, md_count_v_ + 2U - 2U, 2U); + size_t + idx1_ = + ArrayList_remove(md_region, + md_count_v_ + (size_t)2U - (size_t)2U, + md_count_v_ + (size_t)2U - (size_t)2U); + ArrayList_insert(md_region, idx3_, md_count_v_ + (size_t)2U - (size_t)2U, 2U); r_idxs[0U] = idx1_; - r_idxs[2U] = md_count_v_ + 2U - 2U; + r_idxs[2U] = md_count_v_ + (size_t)2U - (size_t)2U; return r; } else { - size_t idx1_ = ArrayList_remove(md_region, md_count_v_ + 2U - 2U, md_count_v_ + 2U - 2U); - ArrayList_insert(md_region, idx2_, md_count_v_ + 2U - 2U, 1U); + size_t + idx1_ = + ArrayList_remove(md_region, + md_count_v_ + (size_t)2U - (size_t)2U, + md_count_v_ + (size_t)2U - (size_t)2U); + ArrayList_insert(md_region, idx2_, md_count_v_ + (size_t)2U - (size_t)2U, 1U); r_idxs[0U] = idx1_; - r_idxs[1U] = md_count_v_ + 2U - 2U; + r_idxs[1U] = md_count_v_ + (size_t)2U - (size_t)2U; return r; } } diff --git a/dist/Slabs2.c b/dist/Slabs2.c index 206d1f70..56f9da56 100644 --- a/dist/Slabs2.c +++ b/dist/Slabs2.c @@ -5,12 +5,6 @@ #include "internal/ArrayList.h" -size_t SlabsCommon2_slab_region_size = 68719476736U; - -size_t SlabsCommon2_slab_size = (size_t)4096U * 64U; - -size_t SlabsCommon2_metadata_max_ex = 262144U; - typedef bool *slab_metadata; static uint8_t *allocate_slot(uint8_t *arr, bool *md) @@ -28,7 +22,7 @@ static bool deallocate_slot(bool *md) static void intro_slab_vprop_empty(uint32_t size_class, uint8_t *arr) { - mmap_strict_trap(arr + (size_t)size_class, SlabsCommon2_slab_size - (size_t)size_class); + mmap_strict_trap(arr + (size_t)size_class, (size_t)4096U * (size_t)64U - (size_t)size_class); } typedef struct tuple4_s @@ -50,14 +44,14 @@ update_quarantine2_aux( ) { ArrayList_cell cell = md_region[idx6]; - if (cell.next != 16777217U) + if (cell.next != (size_t)16777217U) { ArrayList_cell next = md_region[cell.next]; ArrayList_cell next1 = { .prev = cell.prev, .next = next.next, .data = next.data }; md_region[cell.next] = next1; } size_t tl_ = cell.prev; - if (cell.prev != 16777217U) + if (cell.prev != (size_t)16777217U) { ArrayList_cell prev = md_region[cell.prev]; ArrayList_cell prev1 = { .prev = prev.prev, .next = cell.next, .data = prev.data }; @@ -68,7 +62,7 @@ update_quarantine2_aux( hd_ = cell.next; else hd_ = idx5; - size_t sz_ = idx7 - 1U; + size_t sz_ = idx7 - (size_t)1U; ArrayListGen_tuple3 idxs = { .x = hd_, .y = tl_, .z = sz_ }; ArrayList_insert(md_region, idx1, idx6, 0U); return ((tuple4){ .x = idx6, .y = idxs.x, .z = idxs.y, .w = idxs.z }); @@ -83,7 +77,7 @@ update_quarantine2( size_t idx7 ) { - if (idx7 < 1024U) + if (idx7 < (size_t)1024U) return ((tuple4){ .x = idx1, .y = idx5, .z = idx6, .w = idx7 }); else { @@ -96,14 +90,14 @@ static void update_quarantine3_aux(uint32_t size_class, uint8_t *slab_region, tu { size_t idx = idxs.x; uint8_t *ptr = slab_region; - size_t shift_size_t = idx * SlabsCommon2_slab_size; + size_t shift_size_t = idx * ((size_t)4096U * (size_t)64U); mmap_untrap(ptr + shift_size_t, (size_t)size_class); } static void update_quarantine3(uint32_t size_class, uint8_t *slab_region, size_t idx7, tuple4 idxs) { - if (!(idx7 < 1024U)) + if (!(idx7 < (size_t)1024U)) update_quarantine3_aux(size_class, slab_region, idxs); } @@ -124,20 +118,20 @@ deallocate_slab_aux_1_quarantine( tuple4 idxs = update_quarantine2(md_region, idx1, idx5, idx6, idx7); size_t v = ArrayList_remove(md_region, idx3, pos); size_t idx3_ = v; - ArrayList_cell cell = { .prev = 16777217U, .next = idxs.y, .data = 4U }; + ArrayList_cell cell = { .prev = (size_t)16777217U, .next = idxs.y, .data = 4U }; md_region[pos] = cell; - if (idxs.y != 16777217U) + if (idxs.y != (size_t)16777217U) { ArrayList_cell cell1 = md_region[idxs.y]; ArrayList_cell cell2 = { .prev = pos, .next = cell1.next, .data = cell1.data }; md_region[idxs.y] = cell2; } size_t tl_; - if (idxs.y == 16777217U) + if (idxs.y == (size_t)16777217U) tl_ = pos; else tl_ = idxs.z; - size_t sz_ = idxs.w + 1U; + size_t sz_ = idxs.w + (size_t)1U; ArrayListGen_tuple2 idxs_ = { .x1 = tl_, .y1 = sz_ }; update_quarantine3(size_class, slab_region, idx7, idxs); r_idxs[0U] = idxs.x; @@ -147,16 +141,16 @@ deallocate_slab_aux_1_quarantine( r_idxs[6U] = idxs_.y1; } -typedef struct __SlabsCommon2_slab_metadata_Prims_dtuple2___uint8_t_____s +typedef struct __Prims_dtuple2__bool_____Prims_dtuple2__uint8_t_____s { bool *fst; uint8_t *snd; } -__SlabsCommon2_slab_metadata_Prims_dtuple2___uint8_t____; +__Prims_dtuple2__bool_____Prims_dtuple2__uint8_t____; static uint8_t *snd__Prims_dtuple2__bool_____Prims_dtuple2__uint8_t____( - __SlabsCommon2_slab_metadata_Prims_dtuple2___uint8_t____ x + __Prims_dtuple2__bool_____Prims_dtuple2__uint8_t____ x ) { return x.snd; @@ -181,7 +175,7 @@ SlabsFree2_deallocate_slab( size_t idx5_ = r_idxs[4U]; size_t idx6_ = r_idxs[5U]; size_t idx7_ = r_idxs[6U]; - size_t pos = diff_ / SlabsCommon2_slab_size; + size_t pos = diff_ / ((size_t)4096U * (size_t)64U); if (pos < md_count_v_) { uint32_t status1 = ArrayList_read_in_place(md_region, pos); @@ -195,9 +189,9 @@ SlabsFree2_deallocate_slab( bool *ptr10 = md_bm_region; size_t shift_size_t0 = pos; uint8_t *ptr1 = slab_region; - size_t shift_size_t = pos * SlabsCommon2_slab_size; + size_t shift_size_t = pos * ((size_t)4096U * (size_t)64U); apply_zeroing_u8(snd__Prims_dtuple2__bool_____Prims_dtuple2__uint8_t____(( - (__SlabsCommon2_slab_metadata_Prims_dtuple2___uint8_t____){ + (__Prims_dtuple2__bool_____Prims_dtuple2__uint8_t____){ .fst = ptr10 + shift_size_t0, .snd = ptr1 + shift_size_t } @@ -237,7 +231,7 @@ allocate_slab_aux_3_3_2( { KRML_MAYBE_UNUSED_VAR(md_bm_region); uint8_t *ptr = slab_region; - size_t shift_size_t = md_count_v * SlabsCommon2_slab_size; + size_t shift_size_t = md_count_v * ((size_t)4096U * (size_t)64U); intro_slab_vprop_empty(size_class, ptr + shift_size_t); } @@ -267,7 +261,7 @@ allocate_slab_aux_3( ArrayList_insert(md_region, idx1, md_count_v, 0U); allocate_slab_aux_3_3(size_class, slab_region, md_bm_region, md_count_v); size_t v = *md_count; - *md_count = v + 1U; + *md_count = v + (size_t)1U; r_idxs[0U] = md_count_v; } @@ -290,14 +284,14 @@ allocate_slab_aux_4_aux1( ) { ArrayList_cell cell = md_region[idx6]; - if (cell.next != 16777217U) + if (cell.next != (size_t)16777217U) { ArrayList_cell next = md_region[cell.next]; ArrayList_cell next1 = { .prev = cell.prev, .next = next.next, .data = next.data }; md_region[cell.next] = next1; } size_t tl_ = cell.prev; - if (cell.prev != 16777217U) + if (cell.prev != (size_t)16777217U) { ArrayList_cell prev = md_region[cell.prev]; ArrayList_cell prev1 = { .prev = prev.prev, .next = cell.next, .data = prev.data }; @@ -308,7 +302,7 @@ allocate_slab_aux_4_aux1( hd_ = cell.next; else hd_ = idx5; - size_t sz_ = idx7 - 1U; + size_t sz_ = idx7 - (size_t)1U; ArrayListGen_tuple3 idxs = { .x = hd_, .y = tl_, .z = sz_ }; ArrayList_insert(md_region, idx1, idx6, 0U); return ((bounded_tuple_){ .x = idx6, .y = idxs.x, .z = idxs.y, .w = idxs.z }); @@ -318,7 +312,7 @@ static void allocate_slab_aux_4_aux2(uint32_t size_class, uint8_t *slab_region, bounded_tuple_ idxs) { uint8_t *ptr = slab_region; - size_t shift_size_t = idxs.x * SlabsCommon2_slab_size; + size_t shift_size_t = idxs.x * ((size_t)4096U * (size_t)64U); mmap_untrap(ptr + shift_size_t, (size_t)size_class); } @@ -359,10 +353,10 @@ uint8_t size_t idx5_ = r_idxs[4U]; size_t idx6_ = r_idxs[5U]; size_t idx7_ = r_idxs[6U]; - if (idx1_ != 16777217U) + if (idx1_ != (size_t)16777217U) { uint8_t *ptr0 = slab_region; - size_t shift_size_t0 = idx1_ * SlabsCommon2_slab_size; + size_t shift_size_t0 = idx1_ * ((size_t)4096U * (size_t)64U); bool *ptr = md_bm_region; size_t shift_size_t = idx1_; uint8_t *r = allocate_slot(ptr0 + shift_size_t0, ptr + shift_size_t); @@ -375,7 +369,7 @@ uint8_t } else { - bool b = idx7_ >= 256U; + bool b = idx7_ >= (size_t)256U; if (b) { bounded_tuple_ @@ -389,7 +383,7 @@ uint8_t idx6_, idx7_); uint8_t *ptr0 = slab_region; - size_t shift_size_t0 = idxs.x * SlabsCommon2_slab_size; + size_t shift_size_t0 = idxs.x * ((size_t)4096U * (size_t)64U); bool *ptr = md_bm_region; size_t shift_size_t = idxs.x; uint8_t *r = allocate_slot(ptr0 + shift_size_t0, ptr + shift_size_t); @@ -403,7 +397,7 @@ uint8_t else { size_t md_count_v_0 = *md_count; - bool b1 = md_count_v_0 + 1U <= SlabsCommon2_metadata_max_ex; + bool b1 = md_count_v_0 + (size_t)1U <= (size_t)262144U; if (b1) { allocate_slab_aux_3(size_class, @@ -415,7 +409,7 @@ uint8_t md_count_v_, idx1_); uint8_t *ptr0 = slab_region; - size_t shift_size_t0 = md_count_v_ * SlabsCommon2_slab_size; + size_t shift_size_t0 = md_count_v_ * ((size_t)4096U * (size_t)64U); bool *ptr = md_bm_region; size_t shift_size_t = md_count_v_; uint8_t *r = allocate_slot(ptr0 + shift_size_t0, ptr + shift_size_t); diff --git a/dist/StarMalloc.c b/dist/StarMalloc.c index 19b2e79b..5a33f65c 100644 --- a/dist/StarMalloc.c +++ b/dist/StarMalloc.c @@ -3,8 +3,6 @@ #include "internal/StarMalloc.h" -#include "internal/Slabs2.h" - static uint32_t avl_data_size = 64U; extern int64_t Impl_Trees_Cast_M_cmp(Impl_Trees_Cast_M_data uu___, Impl_Trees_Cast_M_data x0); @@ -13,19 +11,15 @@ extern uint8_t *Impl_Trees_Cast_M_ref_node__to__array_u8(Impl_Trees_Cast_M_node extern Impl_Trees_Cast_M_node *Impl_Trees_Cast_M_array_u8__to__ref_node(uint8_t *arr); -size_t Main_metadata_max_ex; - -size_t Main_sc_slab_region_size; - static void init_idxs(size_t *r_idxs) { - r_idxs[0U] = 16777217U; - r_idxs[1U] = 16777217U; - r_idxs[2U] = 16777217U; - r_idxs[3U] = 16777217U; - r_idxs[4U] = 16777217U; - r_idxs[5U] = 16777217U; - r_idxs[6U] = 0U; + r_idxs[0U] = (size_t)16777217U; + r_idxs[1U] = (size_t)16777217U; + r_idxs[2U] = (size_t)16777217U; + r_idxs[3U] = (size_t)16777217U; + r_idxs[4U] = (size_t)16777217U; + r_idxs[5U] = (size_t)16777217U; + r_idxs[6U] = (size_t)0U; } size_t Main_slab_region_size; @@ -47,13 +41,13 @@ init_size_class( { uint32_t size1 = size.case_Sc; static_assert(UINT32_MAX <= SIZE_MAX); - uint8_t *slab_region_ = slab_region + 16777216U * (size_t)4096U * k; - uint64_t *md_bm_region_ = md_bm_region + 67108864U * k; - ArrayList_cell *md_region_ = md_region + 16777216U * k; - size_t *r_idxs = mmap_array_us_init(7U); + uint8_t *slab_region_ = slab_region + (size_t)16777216U * (size_t)4096U * k; + uint64_t *md_bm_region_ = md_bm_region + (size_t)67108864U * k; + ArrayList_cell *md_region_ = md_region + (size_t)16777216U * k; + size_t *r_idxs = mmap_array_us_init((size_t)7U); init_idxs(r_idxs); size_t *md_count = mmap_ptr_us_init(); - *md_count = 0U; + *md_count = (size_t)0U; SizeClass_size_class_struct_ scs = { @@ -92,14 +86,13 @@ init_size_class2( { uint32_t size1 = size.case_Sc_ex; static_assert(UINT32_MAX <= SIZE_MAX); - uint8_t - *slab_region_ = slab_region + SlabsCommon2_metadata_max_ex * SlabsCommon2_slab_size * k; - bool *md_bm_region_ = md_bm_region + SlabsCommon2_metadata_max_ex * k; - ArrayList_cell *md_region_ = md_region + SlabsCommon2_metadata_max_ex * k; - size_t *r_idxs = mmap_array_us_init(7U); + uint8_t *slab_region_ = slab_region + (size_t)262144U * ((size_t)4096U * (size_t)64U) * k; + bool *md_bm_region_ = md_bm_region + (size_t)262144U * k; + ArrayList_cell *md_region_ = md_region + (size_t)262144U * k; + size_t *r_idxs = mmap_array_us_init((size_t)7U); init_idxs(r_idxs); size_t *md_count = mmap_ptr_us_init(); - *md_count = 0U; + *md_count = (size_t)0U; SizeClass_size_class_struct_ scs = { @@ -123,16 +116,15 @@ init_size_class2( void Impl_Trees_Types_init_mmap_md_slabs(Impl_Trees_Types_mmap_md_slabs *ret) { - size_t slab_region_size = 16777216U * (size_t)4096U; - uint8_t *slab_region = mmap_u8_init(slab_region_size); - size_t md_bm_region_size = 67108864U; - size_t md_region_size = 16777216U; + uint8_t *slab_region = mmap_u8_init(Config_sc_slab_region_size); + size_t md_bm_region_size = (size_t)67108864U; + size_t md_region_size = (size_t)16777216U; uint64_t *md_bm_region = mmap_u64_init(md_bm_region_size); ArrayList_cell *md_region = mmap_cell_status_init(md_region_size); - size_t *r_idxs = mmap_array_us_init(7U); + size_t *r_idxs = mmap_array_us_init((size_t)7U); init_idxs(r_idxs); size_t *md_count = mmap_ptr_us_init(); - *md_count = 0U; + *md_count = (size_t)0U; SizeClass_size_class_struct_ scs = { @@ -1277,7 +1269,7 @@ static bool large_free(uint8_t *ptr) { Steel_SpinLock_acquire(&metadata.lock); Impl_Trees_Cast_M_node *md_v = *metadata.data; - Impl_Trees_Cast_M_data k_elem = { .fst = ptr, .snd = 0U }; + Impl_Trees_Cast_M_data k_elem = { .fst = ptr, .snd = (size_t)0U }; FStar_Pervasives_Native_option__size_t size = Map_M_find(md_v, k_elem); bool r; if (uu___is_Some__size_t(size)) @@ -1308,7 +1300,7 @@ static size_t large_getsize_aux(Impl_Trees_Cast_M_node **metadata1, uint8_t *ptr { Impl_Trees_Cast_M_node *md_v = *metadata1; FStar_Pervasives_Native_option__size_t - size = Map_M_find(md_v, ((Impl_Trees_Cast_M_data){ .fst = ptr, .snd = 0U })); + size = Map_M_find(md_v, ((Impl_Trees_Cast_M_data){ .fst = ptr, .snd = (size_t)0U })); if (uu___is_Some__size_t(size)) if (size.tag == FStar_Pervasives_Native_Some) return size.v; @@ -1321,7 +1313,7 @@ static size_t large_getsize_aux(Impl_Trees_Cast_M_node **metadata1, uint8_t *ptr KRML_HOST_EXIT(255U); } else - return 0U; + return (size_t)0U; } static size_t large_getsize(uint8_t *ptr) @@ -1476,930 +1468,943 @@ typedef struct tuple4_s } tuple4; +static size_t gen_arena_slab_region_size(void) +{ + return Config_sc_slab_region_size * (size_t)32U; +} + +static size_t gen_arena_md_bm_region_size(void) +{ + size_t sc_md_bm_region_size = (size_t)67108864U; + return sc_md_bm_region_size * (size_t)27U; +} + +static size_t gen_arena_md_region_size(void) +{ + return (size_t)454295552U; +} + +static size_t gen_arena_md_bm_region_b_size(void) +{ + return (size_t)1310720U; +} + static tuple4 gen_arena_sizes(void) { - size_t arena_slab_region_size = Main_sc_slab_region_size * 32U; - size_t arena_md_bm_region_size = 1811939328U; - size_t arena_md_bm_region_b_size = Main_metadata_max_ex * 5U; - size_t arena_md_region_size = 452984832U + Main_metadata_max_ex * 5U; - return - ( - (tuple4){ - .x = arena_slab_region_size, - .y = arena_md_bm_region_size, - .z = arena_md_bm_region_b_size, - .w = arena_md_region_size - } - ); + size_t x = gen_arena_slab_region_size(); + size_t y = gen_arena_md_bm_region_size(); + size_t w = gen_arena_md_region_size(); + size_t z = gen_arena_md_bm_region_b_size(); + return ((tuple4){ .x = x, .y = y, .z = z, .w = w }); } Main_Meta_size_classes_all Main_Meta_init(void) { tuple4 arena_sizes = gen_arena_sizes(); - uint8_t *slab_region = mmap_u8_init(arena_sizes.x * 4U); - uint64_t *md_bm_region = mmap_u64_init(arena_sizes.y * 4U); - bool *md_bm_region_b = mmap_bool_init(arena_sizes.z * 4U); - ArrayList_cell *md_region = mmap_cell_status_init(arena_sizes.w * 4U); - size_class *size_classes = mmap_sc_init(128U); - size_t offset_ = 0U; + uint8_t *slab_region = mmap_u8_init(arena_sizes.x * (size_t)4U); + uint64_t *md_bm_region = mmap_u64_init(arena_sizes.y * (size_t)4U); + bool *md_bm_region_b = mmap_bool_init(arena_sizes.z * (size_t)4U); + ArrayList_cell *md_region = mmap_cell_status_init(arena_sizes.w * (size_t)4U); + size_class *size_classes = mmap_sc_init((size_t)128U); + size_t offset_ = (size_t)0U; init_size_class(offset_, - 0U, - slab_region + arena_sizes.x * 0U, - md_bm_region + arena_sizes.y * 0U, - md_region + arena_sizes.w * 0U, + (size_t)0U, + slab_region + arena_sizes.x * (size_t)0U, + md_bm_region + arena_sizes.y * (size_t)0U, + md_region + arena_sizes.w * (size_t)0U, size_classes, sizes); init_size_class(offset_, - 1U, - slab_region + arena_sizes.x * 0U, - md_bm_region + arena_sizes.y * 0U, - md_region + arena_sizes.w * 0U, + (size_t)1U, + slab_region + arena_sizes.x * (size_t)0U, + md_bm_region + arena_sizes.y * (size_t)0U, + md_region + arena_sizes.w * (size_t)0U, size_classes, sizes); init_size_class(offset_, - 2U, - slab_region + arena_sizes.x * 0U, - md_bm_region + arena_sizes.y * 0U, - md_region + arena_sizes.w * 0U, + (size_t)2U, + slab_region + arena_sizes.x * (size_t)0U, + md_bm_region + arena_sizes.y * (size_t)0U, + md_region + arena_sizes.w * (size_t)0U, size_classes, sizes); init_size_class(offset_, - 3U, - slab_region + arena_sizes.x * 0U, - md_bm_region + arena_sizes.y * 0U, - md_region + arena_sizes.w * 0U, + (size_t)3U, + slab_region + arena_sizes.x * (size_t)0U, + md_bm_region + arena_sizes.y * (size_t)0U, + md_region + arena_sizes.w * (size_t)0U, size_classes, sizes); init_size_class(offset_, - 4U, - slab_region + arena_sizes.x * 0U, - md_bm_region + arena_sizes.y * 0U, - md_region + arena_sizes.w * 0U, + (size_t)4U, + slab_region + arena_sizes.x * (size_t)0U, + md_bm_region + arena_sizes.y * (size_t)0U, + md_region + arena_sizes.w * (size_t)0U, size_classes, sizes); init_size_class(offset_, - 5U, - slab_region + arena_sizes.x * 0U, - md_bm_region + arena_sizes.y * 0U, - md_region + arena_sizes.w * 0U, + (size_t)5U, + slab_region + arena_sizes.x * (size_t)0U, + md_bm_region + arena_sizes.y * (size_t)0U, + md_region + arena_sizes.w * (size_t)0U, size_classes, sizes); init_size_class(offset_, - 6U, - slab_region + arena_sizes.x * 0U, - md_bm_region + arena_sizes.y * 0U, - md_region + arena_sizes.w * 0U, + (size_t)6U, + slab_region + arena_sizes.x * (size_t)0U, + md_bm_region + arena_sizes.y * (size_t)0U, + md_region + arena_sizes.w * (size_t)0U, size_classes, sizes); init_size_class(offset_, - 7U, - slab_region + arena_sizes.x * 0U, - md_bm_region + arena_sizes.y * 0U, - md_region + arena_sizes.w * 0U, + (size_t)7U, + slab_region + arena_sizes.x * (size_t)0U, + md_bm_region + arena_sizes.y * (size_t)0U, + md_region + arena_sizes.w * (size_t)0U, size_classes, sizes); init_size_class(offset_, - 8U, - slab_region + arena_sizes.x * 0U, - md_bm_region + arena_sizes.y * 0U, - md_region + arena_sizes.w * 0U, + (size_t)8U, + slab_region + arena_sizes.x * (size_t)0U, + md_bm_region + arena_sizes.y * (size_t)0U, + md_region + arena_sizes.w * (size_t)0U, size_classes, sizes); init_size_class(offset_, - 9U, - slab_region + arena_sizes.x * 0U, - md_bm_region + arena_sizes.y * 0U, - md_region + arena_sizes.w * 0U, + (size_t)9U, + slab_region + arena_sizes.x * (size_t)0U, + md_bm_region + arena_sizes.y * (size_t)0U, + md_region + arena_sizes.w * (size_t)0U, size_classes, sizes); init_size_class(offset_, - 10U, - slab_region + arena_sizes.x * 0U, - md_bm_region + arena_sizes.y * 0U, - md_region + arena_sizes.w * 0U, + (size_t)10U, + slab_region + arena_sizes.x * (size_t)0U, + md_bm_region + arena_sizes.y * (size_t)0U, + md_region + arena_sizes.w * (size_t)0U, size_classes, sizes); init_size_class(offset_, - 11U, - slab_region + arena_sizes.x * 0U, - md_bm_region + arena_sizes.y * 0U, - md_region + arena_sizes.w * 0U, + (size_t)11U, + slab_region + arena_sizes.x * (size_t)0U, + md_bm_region + arena_sizes.y * (size_t)0U, + md_region + arena_sizes.w * (size_t)0U, size_classes, sizes); init_size_class(offset_, - 12U, - slab_region + arena_sizes.x * 0U, - md_bm_region + arena_sizes.y * 0U, - md_region + arena_sizes.w * 0U, + (size_t)12U, + slab_region + arena_sizes.x * (size_t)0U, + md_bm_region + arena_sizes.y * (size_t)0U, + md_region + arena_sizes.w * (size_t)0U, size_classes, sizes); init_size_class(offset_, - 13U, - slab_region + arena_sizes.x * 0U, - md_bm_region + arena_sizes.y * 0U, - md_region + arena_sizes.w * 0U, + (size_t)13U, + slab_region + arena_sizes.x * (size_t)0U, + md_bm_region + arena_sizes.y * (size_t)0U, + md_region + arena_sizes.w * (size_t)0U, size_classes, sizes); init_size_class(offset_, - 14U, - slab_region + arena_sizes.x * 0U, - md_bm_region + arena_sizes.y * 0U, - md_region + arena_sizes.w * 0U, + (size_t)14U, + slab_region + arena_sizes.x * (size_t)0U, + md_bm_region + arena_sizes.y * (size_t)0U, + md_region + arena_sizes.w * (size_t)0U, size_classes, sizes); init_size_class(offset_, - 15U, - slab_region + arena_sizes.x * 0U, - md_bm_region + arena_sizes.y * 0U, - md_region + arena_sizes.w * 0U, + (size_t)15U, + slab_region + arena_sizes.x * (size_t)0U, + md_bm_region + arena_sizes.y * (size_t)0U, + md_region + arena_sizes.w * (size_t)0U, size_classes, sizes); init_size_class(offset_, - 16U, - slab_region + arena_sizes.x * 0U, - md_bm_region + arena_sizes.y * 0U, - md_region + arena_sizes.w * 0U, + (size_t)16U, + slab_region + arena_sizes.x * (size_t)0U, + md_bm_region + arena_sizes.y * (size_t)0U, + md_region + arena_sizes.w * (size_t)0U, size_classes, sizes); init_size_class(offset_, - 17U, - slab_region + arena_sizes.x * 0U, - md_bm_region + arena_sizes.y * 0U, - md_region + arena_sizes.w * 0U, + (size_t)17U, + slab_region + arena_sizes.x * (size_t)0U, + md_bm_region + arena_sizes.y * (size_t)0U, + md_region + arena_sizes.w * (size_t)0U, size_classes, sizes); init_size_class(offset_, - 18U, - slab_region + arena_sizes.x * 0U, - md_bm_region + arena_sizes.y * 0U, - md_region + arena_sizes.w * 0U, + (size_t)18U, + slab_region + arena_sizes.x * (size_t)0U, + md_bm_region + arena_sizes.y * (size_t)0U, + md_region + arena_sizes.w * (size_t)0U, size_classes, sizes); init_size_class(offset_, - 19U, - slab_region + arena_sizes.x * 0U, - md_bm_region + arena_sizes.y * 0U, - md_region + arena_sizes.w * 0U, + (size_t)19U, + slab_region + arena_sizes.x * (size_t)0U, + md_bm_region + arena_sizes.y * (size_t)0U, + md_region + arena_sizes.w * (size_t)0U, size_classes, sizes); init_size_class(offset_, - 20U, - slab_region + arena_sizes.x * 0U, - md_bm_region + arena_sizes.y * 0U, - md_region + arena_sizes.w * 0U, + (size_t)20U, + slab_region + arena_sizes.x * (size_t)0U, + md_bm_region + arena_sizes.y * (size_t)0U, + md_region + arena_sizes.w * (size_t)0U, size_classes, sizes); init_size_class(offset_, - 21U, - slab_region + arena_sizes.x * 0U, - md_bm_region + arena_sizes.y * 0U, - md_region + arena_sizes.w * 0U, + (size_t)21U, + slab_region + arena_sizes.x * (size_t)0U, + md_bm_region + arena_sizes.y * (size_t)0U, + md_region + arena_sizes.w * (size_t)0U, size_classes, sizes); init_size_class(offset_, - 22U, - slab_region + arena_sizes.x * 0U, - md_bm_region + arena_sizes.y * 0U, - md_region + arena_sizes.w * 0U, + (size_t)22U, + slab_region + arena_sizes.x * (size_t)0U, + md_bm_region + arena_sizes.y * (size_t)0U, + md_region + arena_sizes.w * (size_t)0U, size_classes, sizes); init_size_class(offset_, - 23U, - slab_region + arena_sizes.x * 0U, - md_bm_region + arena_sizes.y * 0U, - md_region + arena_sizes.w * 0U, + (size_t)23U, + slab_region + arena_sizes.x * (size_t)0U, + md_bm_region + arena_sizes.y * (size_t)0U, + md_region + arena_sizes.w * (size_t)0U, size_classes, sizes); init_size_class(offset_, - 24U, - slab_region + arena_sizes.x * 0U, - md_bm_region + arena_sizes.y * 0U, - md_region + arena_sizes.w * 0U, + (size_t)24U, + slab_region + arena_sizes.x * (size_t)0U, + md_bm_region + arena_sizes.y * (size_t)0U, + md_region + arena_sizes.w * (size_t)0U, size_classes, sizes); init_size_class(offset_, - 25U, - slab_region + arena_sizes.x * 0U, - md_bm_region + arena_sizes.y * 0U, - md_region + arena_sizes.w * 0U, + (size_t)25U, + slab_region + arena_sizes.x * (size_t)0U, + md_bm_region + arena_sizes.y * (size_t)0U, + md_region + arena_sizes.w * (size_t)0U, size_classes, sizes); init_size_class(offset_, - 26U, - slab_region + arena_sizes.x * 0U, - md_bm_region + arena_sizes.y * 0U, - md_region + arena_sizes.w * 0U, + (size_t)26U, + slab_region + arena_sizes.x * (size_t)0U, + md_bm_region + arena_sizes.y * (size_t)0U, + md_region + arena_sizes.w * (size_t)0U, size_classes, sizes); - init_size_class2(offset_ + 27U, - 0U, - slab_region + arena_sizes.x * 0U + 16777216U * (size_t)4096U * 27U, - md_bm_region_b + arena_sizes.z * 0U, - md_region + arena_sizes.w * 0U + 452984832U, - size_classes + 27U, - sizes); - init_size_class2(offset_ + 27U, - 1U, - slab_region + arena_sizes.x * 0U + 16777216U * (size_t)4096U * 27U, - md_bm_region_b + arena_sizes.z * 0U, - md_region + arena_sizes.w * 0U + 452984832U, - size_classes + 27U, - sizes); - init_size_class2(offset_ + 27U, - 2U, - slab_region + arena_sizes.x * 0U + 16777216U * (size_t)4096U * 27U, - md_bm_region_b + arena_sizes.z * 0U, - md_region + arena_sizes.w * 0U + 452984832U, - size_classes + 27U, - sizes); - init_size_class2(offset_ + 27U, - 3U, - slab_region + arena_sizes.x * 0U + 16777216U * (size_t)4096U * 27U, - md_bm_region_b + arena_sizes.z * 0U, - md_region + arena_sizes.w * 0U + 452984832U, - size_classes + 27U, - sizes); - init_size_class2(offset_ + 27U, - 4U, - slab_region + arena_sizes.x * 0U + 16777216U * (size_t)4096U * 27U, - md_bm_region_b + arena_sizes.z * 0U, - md_region + arena_sizes.w * 0U + 452984832U, - size_classes + 27U, - sizes); - size_t offset_0 = 32U; + init_size_class2(offset_ + (size_t)27U, + (size_t)0U, + slab_region + arena_sizes.x * (size_t)0U + (size_t)16777216U * (size_t)4096U * (size_t)27U, + md_bm_region_b + arena_sizes.z * (size_t)0U, + md_region + arena_sizes.w * (size_t)0U + (size_t)452984832U, + size_classes + (size_t)27U, + sizes); + init_size_class2(offset_ + (size_t)27U, + (size_t)1U, + slab_region + arena_sizes.x * (size_t)0U + (size_t)16777216U * (size_t)4096U * (size_t)27U, + md_bm_region_b + arena_sizes.z * (size_t)0U, + md_region + arena_sizes.w * (size_t)0U + (size_t)452984832U, + size_classes + (size_t)27U, + sizes); + init_size_class2(offset_ + (size_t)27U, + (size_t)2U, + slab_region + arena_sizes.x * (size_t)0U + (size_t)16777216U * (size_t)4096U * (size_t)27U, + md_bm_region_b + arena_sizes.z * (size_t)0U, + md_region + arena_sizes.w * (size_t)0U + (size_t)452984832U, + size_classes + (size_t)27U, + sizes); + init_size_class2(offset_ + (size_t)27U, + (size_t)3U, + slab_region + arena_sizes.x * (size_t)0U + (size_t)16777216U * (size_t)4096U * (size_t)27U, + md_bm_region_b + arena_sizes.z * (size_t)0U, + md_region + arena_sizes.w * (size_t)0U + (size_t)452984832U, + size_classes + (size_t)27U, + sizes); + init_size_class2(offset_ + (size_t)27U, + (size_t)4U, + slab_region + arena_sizes.x * (size_t)0U + (size_t)16777216U * (size_t)4096U * (size_t)27U, + md_bm_region_b + arena_sizes.z * (size_t)0U, + md_region + arena_sizes.w * (size_t)0U + (size_t)452984832U, + size_classes + (size_t)27U, + sizes); + size_t offset_0 = (size_t)32U; init_size_class(offset_0, - 0U, - slab_region + arena_sizes.x * 1U, - md_bm_region + arena_sizes.y * 1U, - md_region + arena_sizes.w * 1U, - size_classes + 32U, + (size_t)0U, + slab_region + arena_sizes.x * (size_t)1U, + md_bm_region + arena_sizes.y * (size_t)1U, + md_region + arena_sizes.w * (size_t)1U, + size_classes + (size_t)32U, sizes); init_size_class(offset_0, - 1U, - slab_region + arena_sizes.x * 1U, - md_bm_region + arena_sizes.y * 1U, - md_region + arena_sizes.w * 1U, - size_classes + 32U, + (size_t)1U, + slab_region + arena_sizes.x * (size_t)1U, + md_bm_region + arena_sizes.y * (size_t)1U, + md_region + arena_sizes.w * (size_t)1U, + size_classes + (size_t)32U, sizes); init_size_class(offset_0, - 2U, - slab_region + arena_sizes.x * 1U, - md_bm_region + arena_sizes.y * 1U, - md_region + arena_sizes.w * 1U, - size_classes + 32U, + (size_t)2U, + slab_region + arena_sizes.x * (size_t)1U, + md_bm_region + arena_sizes.y * (size_t)1U, + md_region + arena_sizes.w * (size_t)1U, + size_classes + (size_t)32U, sizes); init_size_class(offset_0, - 3U, - slab_region + arena_sizes.x * 1U, - md_bm_region + arena_sizes.y * 1U, - md_region + arena_sizes.w * 1U, - size_classes + 32U, + (size_t)3U, + slab_region + arena_sizes.x * (size_t)1U, + md_bm_region + arena_sizes.y * (size_t)1U, + md_region + arena_sizes.w * (size_t)1U, + size_classes + (size_t)32U, sizes); init_size_class(offset_0, - 4U, - slab_region + arena_sizes.x * 1U, - md_bm_region + arena_sizes.y * 1U, - md_region + arena_sizes.w * 1U, - size_classes + 32U, + (size_t)4U, + slab_region + arena_sizes.x * (size_t)1U, + md_bm_region + arena_sizes.y * (size_t)1U, + md_region + arena_sizes.w * (size_t)1U, + size_classes + (size_t)32U, sizes); init_size_class(offset_0, - 5U, - slab_region + arena_sizes.x * 1U, - md_bm_region + arena_sizes.y * 1U, - md_region + arena_sizes.w * 1U, - size_classes + 32U, + (size_t)5U, + slab_region + arena_sizes.x * (size_t)1U, + md_bm_region + arena_sizes.y * (size_t)1U, + md_region + arena_sizes.w * (size_t)1U, + size_classes + (size_t)32U, sizes); init_size_class(offset_0, - 6U, - slab_region + arena_sizes.x * 1U, - md_bm_region + arena_sizes.y * 1U, - md_region + arena_sizes.w * 1U, - size_classes + 32U, + (size_t)6U, + slab_region + arena_sizes.x * (size_t)1U, + md_bm_region + arena_sizes.y * (size_t)1U, + md_region + arena_sizes.w * (size_t)1U, + size_classes + (size_t)32U, sizes); init_size_class(offset_0, - 7U, - slab_region + arena_sizes.x * 1U, - md_bm_region + arena_sizes.y * 1U, - md_region + arena_sizes.w * 1U, - size_classes + 32U, + (size_t)7U, + slab_region + arena_sizes.x * (size_t)1U, + md_bm_region + arena_sizes.y * (size_t)1U, + md_region + arena_sizes.w * (size_t)1U, + size_classes + (size_t)32U, sizes); init_size_class(offset_0, - 8U, - slab_region + arena_sizes.x * 1U, - md_bm_region + arena_sizes.y * 1U, - md_region + arena_sizes.w * 1U, - size_classes + 32U, + (size_t)8U, + slab_region + arena_sizes.x * (size_t)1U, + md_bm_region + arena_sizes.y * (size_t)1U, + md_region + arena_sizes.w * (size_t)1U, + size_classes + (size_t)32U, sizes); init_size_class(offset_0, - 9U, - slab_region + arena_sizes.x * 1U, - md_bm_region + arena_sizes.y * 1U, - md_region + arena_sizes.w * 1U, - size_classes + 32U, + (size_t)9U, + slab_region + arena_sizes.x * (size_t)1U, + md_bm_region + arena_sizes.y * (size_t)1U, + md_region + arena_sizes.w * (size_t)1U, + size_classes + (size_t)32U, sizes); init_size_class(offset_0, - 10U, - slab_region + arena_sizes.x * 1U, - md_bm_region + arena_sizes.y * 1U, - md_region + arena_sizes.w * 1U, - size_classes + 32U, + (size_t)10U, + slab_region + arena_sizes.x * (size_t)1U, + md_bm_region + arena_sizes.y * (size_t)1U, + md_region + arena_sizes.w * (size_t)1U, + size_classes + (size_t)32U, sizes); init_size_class(offset_0, - 11U, - slab_region + arena_sizes.x * 1U, - md_bm_region + arena_sizes.y * 1U, - md_region + arena_sizes.w * 1U, - size_classes + 32U, + (size_t)11U, + slab_region + arena_sizes.x * (size_t)1U, + md_bm_region + arena_sizes.y * (size_t)1U, + md_region + arena_sizes.w * (size_t)1U, + size_classes + (size_t)32U, sizes); init_size_class(offset_0, - 12U, - slab_region + arena_sizes.x * 1U, - md_bm_region + arena_sizes.y * 1U, - md_region + arena_sizes.w * 1U, - size_classes + 32U, + (size_t)12U, + slab_region + arena_sizes.x * (size_t)1U, + md_bm_region + arena_sizes.y * (size_t)1U, + md_region + arena_sizes.w * (size_t)1U, + size_classes + (size_t)32U, sizes); init_size_class(offset_0, - 13U, - slab_region + arena_sizes.x * 1U, - md_bm_region + arena_sizes.y * 1U, - md_region + arena_sizes.w * 1U, - size_classes + 32U, + (size_t)13U, + slab_region + arena_sizes.x * (size_t)1U, + md_bm_region + arena_sizes.y * (size_t)1U, + md_region + arena_sizes.w * (size_t)1U, + size_classes + (size_t)32U, sizes); init_size_class(offset_0, - 14U, - slab_region + arena_sizes.x * 1U, - md_bm_region + arena_sizes.y * 1U, - md_region + arena_sizes.w * 1U, - size_classes + 32U, + (size_t)14U, + slab_region + arena_sizes.x * (size_t)1U, + md_bm_region + arena_sizes.y * (size_t)1U, + md_region + arena_sizes.w * (size_t)1U, + size_classes + (size_t)32U, sizes); init_size_class(offset_0, - 15U, - slab_region + arena_sizes.x * 1U, - md_bm_region + arena_sizes.y * 1U, - md_region + arena_sizes.w * 1U, - size_classes + 32U, + (size_t)15U, + slab_region + arena_sizes.x * (size_t)1U, + md_bm_region + arena_sizes.y * (size_t)1U, + md_region + arena_sizes.w * (size_t)1U, + size_classes + (size_t)32U, sizes); init_size_class(offset_0, - 16U, - slab_region + arena_sizes.x * 1U, - md_bm_region + arena_sizes.y * 1U, - md_region + arena_sizes.w * 1U, - size_classes + 32U, + (size_t)16U, + slab_region + arena_sizes.x * (size_t)1U, + md_bm_region + arena_sizes.y * (size_t)1U, + md_region + arena_sizes.w * (size_t)1U, + size_classes + (size_t)32U, sizes); init_size_class(offset_0, - 17U, - slab_region + arena_sizes.x * 1U, - md_bm_region + arena_sizes.y * 1U, - md_region + arena_sizes.w * 1U, - size_classes + 32U, + (size_t)17U, + slab_region + arena_sizes.x * (size_t)1U, + md_bm_region + arena_sizes.y * (size_t)1U, + md_region + arena_sizes.w * (size_t)1U, + size_classes + (size_t)32U, sizes); init_size_class(offset_0, - 18U, - slab_region + arena_sizes.x * 1U, - md_bm_region + arena_sizes.y * 1U, - md_region + arena_sizes.w * 1U, - size_classes + 32U, + (size_t)18U, + slab_region + arena_sizes.x * (size_t)1U, + md_bm_region + arena_sizes.y * (size_t)1U, + md_region + arena_sizes.w * (size_t)1U, + size_classes + (size_t)32U, sizes); init_size_class(offset_0, - 19U, - slab_region + arena_sizes.x * 1U, - md_bm_region + arena_sizes.y * 1U, - md_region + arena_sizes.w * 1U, - size_classes + 32U, + (size_t)19U, + slab_region + arena_sizes.x * (size_t)1U, + md_bm_region + arena_sizes.y * (size_t)1U, + md_region + arena_sizes.w * (size_t)1U, + size_classes + (size_t)32U, sizes); init_size_class(offset_0, - 20U, - slab_region + arena_sizes.x * 1U, - md_bm_region + arena_sizes.y * 1U, - md_region + arena_sizes.w * 1U, - size_classes + 32U, + (size_t)20U, + slab_region + arena_sizes.x * (size_t)1U, + md_bm_region + arena_sizes.y * (size_t)1U, + md_region + arena_sizes.w * (size_t)1U, + size_classes + (size_t)32U, sizes); init_size_class(offset_0, - 21U, - slab_region + arena_sizes.x * 1U, - md_bm_region + arena_sizes.y * 1U, - md_region + arena_sizes.w * 1U, - size_classes + 32U, + (size_t)21U, + slab_region + arena_sizes.x * (size_t)1U, + md_bm_region + arena_sizes.y * (size_t)1U, + md_region + arena_sizes.w * (size_t)1U, + size_classes + (size_t)32U, sizes); init_size_class(offset_0, - 22U, - slab_region + arena_sizes.x * 1U, - md_bm_region + arena_sizes.y * 1U, - md_region + arena_sizes.w * 1U, - size_classes + 32U, + (size_t)22U, + slab_region + arena_sizes.x * (size_t)1U, + md_bm_region + arena_sizes.y * (size_t)1U, + md_region + arena_sizes.w * (size_t)1U, + size_classes + (size_t)32U, sizes); init_size_class(offset_0, - 23U, - slab_region + arena_sizes.x * 1U, - md_bm_region + arena_sizes.y * 1U, - md_region + arena_sizes.w * 1U, - size_classes + 32U, + (size_t)23U, + slab_region + arena_sizes.x * (size_t)1U, + md_bm_region + arena_sizes.y * (size_t)1U, + md_region + arena_sizes.w * (size_t)1U, + size_classes + (size_t)32U, sizes); init_size_class(offset_0, - 24U, - slab_region + arena_sizes.x * 1U, - md_bm_region + arena_sizes.y * 1U, - md_region + arena_sizes.w * 1U, - size_classes + 32U, + (size_t)24U, + slab_region + arena_sizes.x * (size_t)1U, + md_bm_region + arena_sizes.y * (size_t)1U, + md_region + arena_sizes.w * (size_t)1U, + size_classes + (size_t)32U, sizes); init_size_class(offset_0, - 25U, - slab_region + arena_sizes.x * 1U, - md_bm_region + arena_sizes.y * 1U, - md_region + arena_sizes.w * 1U, - size_classes + 32U, + (size_t)25U, + slab_region + arena_sizes.x * (size_t)1U, + md_bm_region + arena_sizes.y * (size_t)1U, + md_region + arena_sizes.w * (size_t)1U, + size_classes + (size_t)32U, sizes); init_size_class(offset_0, - 26U, - slab_region + arena_sizes.x * 1U, - md_bm_region + arena_sizes.y * 1U, - md_region + arena_sizes.w * 1U, - size_classes + 32U, - sizes); - init_size_class2(offset_0 + 27U, - 0U, - slab_region + arena_sizes.x * 1U + 16777216U * (size_t)4096U * 27U, - md_bm_region_b + arena_sizes.z * 1U, - md_region + arena_sizes.w * 1U + 452984832U, - size_classes + 32U + 27U, - sizes); - init_size_class2(offset_0 + 27U, - 1U, - slab_region + arena_sizes.x * 1U + 16777216U * (size_t)4096U * 27U, - md_bm_region_b + arena_sizes.z * 1U, - md_region + arena_sizes.w * 1U + 452984832U, - size_classes + 32U + 27U, - sizes); - init_size_class2(offset_0 + 27U, - 2U, - slab_region + arena_sizes.x * 1U + 16777216U * (size_t)4096U * 27U, - md_bm_region_b + arena_sizes.z * 1U, - md_region + arena_sizes.w * 1U + 452984832U, - size_classes + 32U + 27U, - sizes); - init_size_class2(offset_0 + 27U, - 3U, - slab_region + arena_sizes.x * 1U + 16777216U * (size_t)4096U * 27U, - md_bm_region_b + arena_sizes.z * 1U, - md_region + arena_sizes.w * 1U + 452984832U, - size_classes + 32U + 27U, - sizes); - init_size_class2(offset_0 + 27U, - 4U, - slab_region + arena_sizes.x * 1U + 16777216U * (size_t)4096U * 27U, - md_bm_region_b + arena_sizes.z * 1U, - md_region + arena_sizes.w * 1U + 452984832U, - size_classes + 32U + 27U, - sizes); - size_t offset_1 = 64U; + (size_t)26U, + slab_region + arena_sizes.x * (size_t)1U, + md_bm_region + arena_sizes.y * (size_t)1U, + md_region + arena_sizes.w * (size_t)1U, + size_classes + (size_t)32U, + sizes); + init_size_class2(offset_0 + (size_t)27U, + (size_t)0U, + slab_region + arena_sizes.x * (size_t)1U + (size_t)16777216U * (size_t)4096U * (size_t)27U, + md_bm_region_b + arena_sizes.z * (size_t)1U, + md_region + arena_sizes.w * (size_t)1U + (size_t)452984832U, + size_classes + (size_t)32U + (size_t)27U, + sizes); + init_size_class2(offset_0 + (size_t)27U, + (size_t)1U, + slab_region + arena_sizes.x * (size_t)1U + (size_t)16777216U * (size_t)4096U * (size_t)27U, + md_bm_region_b + arena_sizes.z * (size_t)1U, + md_region + arena_sizes.w * (size_t)1U + (size_t)452984832U, + size_classes + (size_t)32U + (size_t)27U, + sizes); + init_size_class2(offset_0 + (size_t)27U, + (size_t)2U, + slab_region + arena_sizes.x * (size_t)1U + (size_t)16777216U * (size_t)4096U * (size_t)27U, + md_bm_region_b + arena_sizes.z * (size_t)1U, + md_region + arena_sizes.w * (size_t)1U + (size_t)452984832U, + size_classes + (size_t)32U + (size_t)27U, + sizes); + init_size_class2(offset_0 + (size_t)27U, + (size_t)3U, + slab_region + arena_sizes.x * (size_t)1U + (size_t)16777216U * (size_t)4096U * (size_t)27U, + md_bm_region_b + arena_sizes.z * (size_t)1U, + md_region + arena_sizes.w * (size_t)1U + (size_t)452984832U, + size_classes + (size_t)32U + (size_t)27U, + sizes); + init_size_class2(offset_0 + (size_t)27U, + (size_t)4U, + slab_region + arena_sizes.x * (size_t)1U + (size_t)16777216U * (size_t)4096U * (size_t)27U, + md_bm_region_b + arena_sizes.z * (size_t)1U, + md_region + arena_sizes.w * (size_t)1U + (size_t)452984832U, + size_classes + (size_t)32U + (size_t)27U, + sizes); + size_t offset_1 = (size_t)64U; init_size_class(offset_1, - 0U, - slab_region + arena_sizes.x * 2U, - md_bm_region + arena_sizes.y * 2U, - md_region + arena_sizes.w * 2U, - size_classes + 64U, + (size_t)0U, + slab_region + arena_sizes.x * (size_t)2U, + md_bm_region + arena_sizes.y * (size_t)2U, + md_region + arena_sizes.w * (size_t)2U, + size_classes + (size_t)64U, sizes); init_size_class(offset_1, - 1U, - slab_region + arena_sizes.x * 2U, - md_bm_region + arena_sizes.y * 2U, - md_region + arena_sizes.w * 2U, - size_classes + 64U, + (size_t)1U, + slab_region + arena_sizes.x * (size_t)2U, + md_bm_region + arena_sizes.y * (size_t)2U, + md_region + arena_sizes.w * (size_t)2U, + size_classes + (size_t)64U, sizes); init_size_class(offset_1, - 2U, - slab_region + arena_sizes.x * 2U, - md_bm_region + arena_sizes.y * 2U, - md_region + arena_sizes.w * 2U, - size_classes + 64U, + (size_t)2U, + slab_region + arena_sizes.x * (size_t)2U, + md_bm_region + arena_sizes.y * (size_t)2U, + md_region + arena_sizes.w * (size_t)2U, + size_classes + (size_t)64U, sizes); init_size_class(offset_1, - 3U, - slab_region + arena_sizes.x * 2U, - md_bm_region + arena_sizes.y * 2U, - md_region + arena_sizes.w * 2U, - size_classes + 64U, + (size_t)3U, + slab_region + arena_sizes.x * (size_t)2U, + md_bm_region + arena_sizes.y * (size_t)2U, + md_region + arena_sizes.w * (size_t)2U, + size_classes + (size_t)64U, sizes); init_size_class(offset_1, - 4U, - slab_region + arena_sizes.x * 2U, - md_bm_region + arena_sizes.y * 2U, - md_region + arena_sizes.w * 2U, - size_classes + 64U, + (size_t)4U, + slab_region + arena_sizes.x * (size_t)2U, + md_bm_region + arena_sizes.y * (size_t)2U, + md_region + arena_sizes.w * (size_t)2U, + size_classes + (size_t)64U, sizes); init_size_class(offset_1, - 5U, - slab_region + arena_sizes.x * 2U, - md_bm_region + arena_sizes.y * 2U, - md_region + arena_sizes.w * 2U, - size_classes + 64U, + (size_t)5U, + slab_region + arena_sizes.x * (size_t)2U, + md_bm_region + arena_sizes.y * (size_t)2U, + md_region + arena_sizes.w * (size_t)2U, + size_classes + (size_t)64U, sizes); init_size_class(offset_1, - 6U, - slab_region + arena_sizes.x * 2U, - md_bm_region + arena_sizes.y * 2U, - md_region + arena_sizes.w * 2U, - size_classes + 64U, + (size_t)6U, + slab_region + arena_sizes.x * (size_t)2U, + md_bm_region + arena_sizes.y * (size_t)2U, + md_region + arena_sizes.w * (size_t)2U, + size_classes + (size_t)64U, sizes); init_size_class(offset_1, - 7U, - slab_region + arena_sizes.x * 2U, - md_bm_region + arena_sizes.y * 2U, - md_region + arena_sizes.w * 2U, - size_classes + 64U, + (size_t)7U, + slab_region + arena_sizes.x * (size_t)2U, + md_bm_region + arena_sizes.y * (size_t)2U, + md_region + arena_sizes.w * (size_t)2U, + size_classes + (size_t)64U, sizes); init_size_class(offset_1, - 8U, - slab_region + arena_sizes.x * 2U, - md_bm_region + arena_sizes.y * 2U, - md_region + arena_sizes.w * 2U, - size_classes + 64U, + (size_t)8U, + slab_region + arena_sizes.x * (size_t)2U, + md_bm_region + arena_sizes.y * (size_t)2U, + md_region + arena_sizes.w * (size_t)2U, + size_classes + (size_t)64U, sizes); init_size_class(offset_1, - 9U, - slab_region + arena_sizes.x * 2U, - md_bm_region + arena_sizes.y * 2U, - md_region + arena_sizes.w * 2U, - size_classes + 64U, + (size_t)9U, + slab_region + arena_sizes.x * (size_t)2U, + md_bm_region + arena_sizes.y * (size_t)2U, + md_region + arena_sizes.w * (size_t)2U, + size_classes + (size_t)64U, sizes); init_size_class(offset_1, - 10U, - slab_region + arena_sizes.x * 2U, - md_bm_region + arena_sizes.y * 2U, - md_region + arena_sizes.w * 2U, - size_classes + 64U, + (size_t)10U, + slab_region + arena_sizes.x * (size_t)2U, + md_bm_region + arena_sizes.y * (size_t)2U, + md_region + arena_sizes.w * (size_t)2U, + size_classes + (size_t)64U, sizes); init_size_class(offset_1, - 11U, - slab_region + arena_sizes.x * 2U, - md_bm_region + arena_sizes.y * 2U, - md_region + arena_sizes.w * 2U, - size_classes + 64U, + (size_t)11U, + slab_region + arena_sizes.x * (size_t)2U, + md_bm_region + arena_sizes.y * (size_t)2U, + md_region + arena_sizes.w * (size_t)2U, + size_classes + (size_t)64U, sizes); init_size_class(offset_1, - 12U, - slab_region + arena_sizes.x * 2U, - md_bm_region + arena_sizes.y * 2U, - md_region + arena_sizes.w * 2U, - size_classes + 64U, + (size_t)12U, + slab_region + arena_sizes.x * (size_t)2U, + md_bm_region + arena_sizes.y * (size_t)2U, + md_region + arena_sizes.w * (size_t)2U, + size_classes + (size_t)64U, sizes); init_size_class(offset_1, - 13U, - slab_region + arena_sizes.x * 2U, - md_bm_region + arena_sizes.y * 2U, - md_region + arena_sizes.w * 2U, - size_classes + 64U, + (size_t)13U, + slab_region + arena_sizes.x * (size_t)2U, + md_bm_region + arena_sizes.y * (size_t)2U, + md_region + arena_sizes.w * (size_t)2U, + size_classes + (size_t)64U, sizes); init_size_class(offset_1, - 14U, - slab_region + arena_sizes.x * 2U, - md_bm_region + arena_sizes.y * 2U, - md_region + arena_sizes.w * 2U, - size_classes + 64U, + (size_t)14U, + slab_region + arena_sizes.x * (size_t)2U, + md_bm_region + arena_sizes.y * (size_t)2U, + md_region + arena_sizes.w * (size_t)2U, + size_classes + (size_t)64U, sizes); init_size_class(offset_1, - 15U, - slab_region + arena_sizes.x * 2U, - md_bm_region + arena_sizes.y * 2U, - md_region + arena_sizes.w * 2U, - size_classes + 64U, + (size_t)15U, + slab_region + arena_sizes.x * (size_t)2U, + md_bm_region + arena_sizes.y * (size_t)2U, + md_region + arena_sizes.w * (size_t)2U, + size_classes + (size_t)64U, sizes); init_size_class(offset_1, - 16U, - slab_region + arena_sizes.x * 2U, - md_bm_region + arena_sizes.y * 2U, - md_region + arena_sizes.w * 2U, - size_classes + 64U, + (size_t)16U, + slab_region + arena_sizes.x * (size_t)2U, + md_bm_region + arena_sizes.y * (size_t)2U, + md_region + arena_sizes.w * (size_t)2U, + size_classes + (size_t)64U, sizes); init_size_class(offset_1, - 17U, - slab_region + arena_sizes.x * 2U, - md_bm_region + arena_sizes.y * 2U, - md_region + arena_sizes.w * 2U, - size_classes + 64U, + (size_t)17U, + slab_region + arena_sizes.x * (size_t)2U, + md_bm_region + arena_sizes.y * (size_t)2U, + md_region + arena_sizes.w * (size_t)2U, + size_classes + (size_t)64U, sizes); init_size_class(offset_1, - 18U, - slab_region + arena_sizes.x * 2U, - md_bm_region + arena_sizes.y * 2U, - md_region + arena_sizes.w * 2U, - size_classes + 64U, + (size_t)18U, + slab_region + arena_sizes.x * (size_t)2U, + md_bm_region + arena_sizes.y * (size_t)2U, + md_region + arena_sizes.w * (size_t)2U, + size_classes + (size_t)64U, sizes); init_size_class(offset_1, - 19U, - slab_region + arena_sizes.x * 2U, - md_bm_region + arena_sizes.y * 2U, - md_region + arena_sizes.w * 2U, - size_classes + 64U, + (size_t)19U, + slab_region + arena_sizes.x * (size_t)2U, + md_bm_region + arena_sizes.y * (size_t)2U, + md_region + arena_sizes.w * (size_t)2U, + size_classes + (size_t)64U, sizes); init_size_class(offset_1, - 20U, - slab_region + arena_sizes.x * 2U, - md_bm_region + arena_sizes.y * 2U, - md_region + arena_sizes.w * 2U, - size_classes + 64U, + (size_t)20U, + slab_region + arena_sizes.x * (size_t)2U, + md_bm_region + arena_sizes.y * (size_t)2U, + md_region + arena_sizes.w * (size_t)2U, + size_classes + (size_t)64U, sizes); init_size_class(offset_1, - 21U, - slab_region + arena_sizes.x * 2U, - md_bm_region + arena_sizes.y * 2U, - md_region + arena_sizes.w * 2U, - size_classes + 64U, + (size_t)21U, + slab_region + arena_sizes.x * (size_t)2U, + md_bm_region + arena_sizes.y * (size_t)2U, + md_region + arena_sizes.w * (size_t)2U, + size_classes + (size_t)64U, sizes); init_size_class(offset_1, - 22U, - slab_region + arena_sizes.x * 2U, - md_bm_region + arena_sizes.y * 2U, - md_region + arena_sizes.w * 2U, - size_classes + 64U, + (size_t)22U, + slab_region + arena_sizes.x * (size_t)2U, + md_bm_region + arena_sizes.y * (size_t)2U, + md_region + arena_sizes.w * (size_t)2U, + size_classes + (size_t)64U, sizes); init_size_class(offset_1, - 23U, - slab_region + arena_sizes.x * 2U, - md_bm_region + arena_sizes.y * 2U, - md_region + arena_sizes.w * 2U, - size_classes + 64U, + (size_t)23U, + slab_region + arena_sizes.x * (size_t)2U, + md_bm_region + arena_sizes.y * (size_t)2U, + md_region + arena_sizes.w * (size_t)2U, + size_classes + (size_t)64U, sizes); init_size_class(offset_1, - 24U, - slab_region + arena_sizes.x * 2U, - md_bm_region + arena_sizes.y * 2U, - md_region + arena_sizes.w * 2U, - size_classes + 64U, + (size_t)24U, + slab_region + arena_sizes.x * (size_t)2U, + md_bm_region + arena_sizes.y * (size_t)2U, + md_region + arena_sizes.w * (size_t)2U, + size_classes + (size_t)64U, sizes); init_size_class(offset_1, - 25U, - slab_region + arena_sizes.x * 2U, - md_bm_region + arena_sizes.y * 2U, - md_region + arena_sizes.w * 2U, - size_classes + 64U, + (size_t)25U, + slab_region + arena_sizes.x * (size_t)2U, + md_bm_region + arena_sizes.y * (size_t)2U, + md_region + arena_sizes.w * (size_t)2U, + size_classes + (size_t)64U, sizes); init_size_class(offset_1, - 26U, - slab_region + arena_sizes.x * 2U, - md_bm_region + arena_sizes.y * 2U, - md_region + arena_sizes.w * 2U, - size_classes + 64U, - sizes); - init_size_class2(offset_1 + 27U, - 0U, - slab_region + arena_sizes.x * 2U + 16777216U * (size_t)4096U * 27U, - md_bm_region_b + arena_sizes.z * 2U, - md_region + arena_sizes.w * 2U + 452984832U, - size_classes + 64U + 27U, - sizes); - init_size_class2(offset_1 + 27U, - 1U, - slab_region + arena_sizes.x * 2U + 16777216U * (size_t)4096U * 27U, - md_bm_region_b + arena_sizes.z * 2U, - md_region + arena_sizes.w * 2U + 452984832U, - size_classes + 64U + 27U, - sizes); - init_size_class2(offset_1 + 27U, - 2U, - slab_region + arena_sizes.x * 2U + 16777216U * (size_t)4096U * 27U, - md_bm_region_b + arena_sizes.z * 2U, - md_region + arena_sizes.w * 2U + 452984832U, - size_classes + 64U + 27U, - sizes); - init_size_class2(offset_1 + 27U, - 3U, - slab_region + arena_sizes.x * 2U + 16777216U * (size_t)4096U * 27U, - md_bm_region_b + arena_sizes.z * 2U, - md_region + arena_sizes.w * 2U + 452984832U, - size_classes + 64U + 27U, - sizes); - init_size_class2(offset_1 + 27U, - 4U, - slab_region + arena_sizes.x * 2U + 16777216U * (size_t)4096U * 27U, - md_bm_region_b + arena_sizes.z * 2U, - md_region + arena_sizes.w * 2U + 452984832U, - size_classes + 64U + 27U, - sizes); - size_t offset_2 = 96U; + (size_t)26U, + slab_region + arena_sizes.x * (size_t)2U, + md_bm_region + arena_sizes.y * (size_t)2U, + md_region + arena_sizes.w * (size_t)2U, + size_classes + (size_t)64U, + sizes); + init_size_class2(offset_1 + (size_t)27U, + (size_t)0U, + slab_region + arena_sizes.x * (size_t)2U + (size_t)16777216U * (size_t)4096U * (size_t)27U, + md_bm_region_b + arena_sizes.z * (size_t)2U, + md_region + arena_sizes.w * (size_t)2U + (size_t)452984832U, + size_classes + (size_t)64U + (size_t)27U, + sizes); + init_size_class2(offset_1 + (size_t)27U, + (size_t)1U, + slab_region + arena_sizes.x * (size_t)2U + (size_t)16777216U * (size_t)4096U * (size_t)27U, + md_bm_region_b + arena_sizes.z * (size_t)2U, + md_region + arena_sizes.w * (size_t)2U + (size_t)452984832U, + size_classes + (size_t)64U + (size_t)27U, + sizes); + init_size_class2(offset_1 + (size_t)27U, + (size_t)2U, + slab_region + arena_sizes.x * (size_t)2U + (size_t)16777216U * (size_t)4096U * (size_t)27U, + md_bm_region_b + arena_sizes.z * (size_t)2U, + md_region + arena_sizes.w * (size_t)2U + (size_t)452984832U, + size_classes + (size_t)64U + (size_t)27U, + sizes); + init_size_class2(offset_1 + (size_t)27U, + (size_t)3U, + slab_region + arena_sizes.x * (size_t)2U + (size_t)16777216U * (size_t)4096U * (size_t)27U, + md_bm_region_b + arena_sizes.z * (size_t)2U, + md_region + arena_sizes.w * (size_t)2U + (size_t)452984832U, + size_classes + (size_t)64U + (size_t)27U, + sizes); + init_size_class2(offset_1 + (size_t)27U, + (size_t)4U, + slab_region + arena_sizes.x * (size_t)2U + (size_t)16777216U * (size_t)4096U * (size_t)27U, + md_bm_region_b + arena_sizes.z * (size_t)2U, + md_region + arena_sizes.w * (size_t)2U + (size_t)452984832U, + size_classes + (size_t)64U + (size_t)27U, + sizes); + size_t offset_2 = (size_t)96U; init_size_class(offset_2, - 0U, - slab_region + arena_sizes.x * 3U, - md_bm_region + arena_sizes.y * 3U, - md_region + arena_sizes.w * 3U, - size_classes + 96U, + (size_t)0U, + slab_region + arena_sizes.x * (size_t)3U, + md_bm_region + arena_sizes.y * (size_t)3U, + md_region + arena_sizes.w * (size_t)3U, + size_classes + (size_t)96U, sizes); init_size_class(offset_2, - 1U, - slab_region + arena_sizes.x * 3U, - md_bm_region + arena_sizes.y * 3U, - md_region + arena_sizes.w * 3U, - size_classes + 96U, + (size_t)1U, + slab_region + arena_sizes.x * (size_t)3U, + md_bm_region + arena_sizes.y * (size_t)3U, + md_region + arena_sizes.w * (size_t)3U, + size_classes + (size_t)96U, sizes); init_size_class(offset_2, - 2U, - slab_region + arena_sizes.x * 3U, - md_bm_region + arena_sizes.y * 3U, - md_region + arena_sizes.w * 3U, - size_classes + 96U, + (size_t)2U, + slab_region + arena_sizes.x * (size_t)3U, + md_bm_region + arena_sizes.y * (size_t)3U, + md_region + arena_sizes.w * (size_t)3U, + size_classes + (size_t)96U, sizes); init_size_class(offset_2, - 3U, - slab_region + arena_sizes.x * 3U, - md_bm_region + arena_sizes.y * 3U, - md_region + arena_sizes.w * 3U, - size_classes + 96U, + (size_t)3U, + slab_region + arena_sizes.x * (size_t)3U, + md_bm_region + arena_sizes.y * (size_t)3U, + md_region + arena_sizes.w * (size_t)3U, + size_classes + (size_t)96U, sizes); init_size_class(offset_2, - 4U, - slab_region + arena_sizes.x * 3U, - md_bm_region + arena_sizes.y * 3U, - md_region + arena_sizes.w * 3U, - size_classes + 96U, + (size_t)4U, + slab_region + arena_sizes.x * (size_t)3U, + md_bm_region + arena_sizes.y * (size_t)3U, + md_region + arena_sizes.w * (size_t)3U, + size_classes + (size_t)96U, sizes); init_size_class(offset_2, - 5U, - slab_region + arena_sizes.x * 3U, - md_bm_region + arena_sizes.y * 3U, - md_region + arena_sizes.w * 3U, - size_classes + 96U, + (size_t)5U, + slab_region + arena_sizes.x * (size_t)3U, + md_bm_region + arena_sizes.y * (size_t)3U, + md_region + arena_sizes.w * (size_t)3U, + size_classes + (size_t)96U, sizes); init_size_class(offset_2, - 6U, - slab_region + arena_sizes.x * 3U, - md_bm_region + arena_sizes.y * 3U, - md_region + arena_sizes.w * 3U, - size_classes + 96U, + (size_t)6U, + slab_region + arena_sizes.x * (size_t)3U, + md_bm_region + arena_sizes.y * (size_t)3U, + md_region + arena_sizes.w * (size_t)3U, + size_classes + (size_t)96U, sizes); init_size_class(offset_2, - 7U, - slab_region + arena_sizes.x * 3U, - md_bm_region + arena_sizes.y * 3U, - md_region + arena_sizes.w * 3U, - size_classes + 96U, + (size_t)7U, + slab_region + arena_sizes.x * (size_t)3U, + md_bm_region + arena_sizes.y * (size_t)3U, + md_region + arena_sizes.w * (size_t)3U, + size_classes + (size_t)96U, sizes); init_size_class(offset_2, - 8U, - slab_region + arena_sizes.x * 3U, - md_bm_region + arena_sizes.y * 3U, - md_region + arena_sizes.w * 3U, - size_classes + 96U, + (size_t)8U, + slab_region + arena_sizes.x * (size_t)3U, + md_bm_region + arena_sizes.y * (size_t)3U, + md_region + arena_sizes.w * (size_t)3U, + size_classes + (size_t)96U, sizes); init_size_class(offset_2, - 9U, - slab_region + arena_sizes.x * 3U, - md_bm_region + arena_sizes.y * 3U, - md_region + arena_sizes.w * 3U, - size_classes + 96U, + (size_t)9U, + slab_region + arena_sizes.x * (size_t)3U, + md_bm_region + arena_sizes.y * (size_t)3U, + md_region + arena_sizes.w * (size_t)3U, + size_classes + (size_t)96U, sizes); init_size_class(offset_2, - 10U, - slab_region + arena_sizes.x * 3U, - md_bm_region + arena_sizes.y * 3U, - md_region + arena_sizes.w * 3U, - size_classes + 96U, + (size_t)10U, + slab_region + arena_sizes.x * (size_t)3U, + md_bm_region + arena_sizes.y * (size_t)3U, + md_region + arena_sizes.w * (size_t)3U, + size_classes + (size_t)96U, sizes); init_size_class(offset_2, - 11U, - slab_region + arena_sizes.x * 3U, - md_bm_region + arena_sizes.y * 3U, - md_region + arena_sizes.w * 3U, - size_classes + 96U, + (size_t)11U, + slab_region + arena_sizes.x * (size_t)3U, + md_bm_region + arena_sizes.y * (size_t)3U, + md_region + arena_sizes.w * (size_t)3U, + size_classes + (size_t)96U, sizes); init_size_class(offset_2, - 12U, - slab_region + arena_sizes.x * 3U, - md_bm_region + arena_sizes.y * 3U, - md_region + arena_sizes.w * 3U, - size_classes + 96U, + (size_t)12U, + slab_region + arena_sizes.x * (size_t)3U, + md_bm_region + arena_sizes.y * (size_t)3U, + md_region + arena_sizes.w * (size_t)3U, + size_classes + (size_t)96U, sizes); init_size_class(offset_2, - 13U, - slab_region + arena_sizes.x * 3U, - md_bm_region + arena_sizes.y * 3U, - md_region + arena_sizes.w * 3U, - size_classes + 96U, + (size_t)13U, + slab_region + arena_sizes.x * (size_t)3U, + md_bm_region + arena_sizes.y * (size_t)3U, + md_region + arena_sizes.w * (size_t)3U, + size_classes + (size_t)96U, sizes); init_size_class(offset_2, - 14U, - slab_region + arena_sizes.x * 3U, - md_bm_region + arena_sizes.y * 3U, - md_region + arena_sizes.w * 3U, - size_classes + 96U, + (size_t)14U, + slab_region + arena_sizes.x * (size_t)3U, + md_bm_region + arena_sizes.y * (size_t)3U, + md_region + arena_sizes.w * (size_t)3U, + size_classes + (size_t)96U, sizes); init_size_class(offset_2, - 15U, - slab_region + arena_sizes.x * 3U, - md_bm_region + arena_sizes.y * 3U, - md_region + arena_sizes.w * 3U, - size_classes + 96U, + (size_t)15U, + slab_region + arena_sizes.x * (size_t)3U, + md_bm_region + arena_sizes.y * (size_t)3U, + md_region + arena_sizes.w * (size_t)3U, + size_classes + (size_t)96U, sizes); init_size_class(offset_2, - 16U, - slab_region + arena_sizes.x * 3U, - md_bm_region + arena_sizes.y * 3U, - md_region + arena_sizes.w * 3U, - size_classes + 96U, + (size_t)16U, + slab_region + arena_sizes.x * (size_t)3U, + md_bm_region + arena_sizes.y * (size_t)3U, + md_region + arena_sizes.w * (size_t)3U, + size_classes + (size_t)96U, sizes); init_size_class(offset_2, - 17U, - slab_region + arena_sizes.x * 3U, - md_bm_region + arena_sizes.y * 3U, - md_region + arena_sizes.w * 3U, - size_classes + 96U, + (size_t)17U, + slab_region + arena_sizes.x * (size_t)3U, + md_bm_region + arena_sizes.y * (size_t)3U, + md_region + arena_sizes.w * (size_t)3U, + size_classes + (size_t)96U, sizes); init_size_class(offset_2, - 18U, - slab_region + arena_sizes.x * 3U, - md_bm_region + arena_sizes.y * 3U, - md_region + arena_sizes.w * 3U, - size_classes + 96U, + (size_t)18U, + slab_region + arena_sizes.x * (size_t)3U, + md_bm_region + arena_sizes.y * (size_t)3U, + md_region + arena_sizes.w * (size_t)3U, + size_classes + (size_t)96U, sizes); init_size_class(offset_2, - 19U, - slab_region + arena_sizes.x * 3U, - md_bm_region + arena_sizes.y * 3U, - md_region + arena_sizes.w * 3U, - size_classes + 96U, + (size_t)19U, + slab_region + arena_sizes.x * (size_t)3U, + md_bm_region + arena_sizes.y * (size_t)3U, + md_region + arena_sizes.w * (size_t)3U, + size_classes + (size_t)96U, sizes); init_size_class(offset_2, - 20U, - slab_region + arena_sizes.x * 3U, - md_bm_region + arena_sizes.y * 3U, - md_region + arena_sizes.w * 3U, - size_classes + 96U, + (size_t)20U, + slab_region + arena_sizes.x * (size_t)3U, + md_bm_region + arena_sizes.y * (size_t)3U, + md_region + arena_sizes.w * (size_t)3U, + size_classes + (size_t)96U, sizes); init_size_class(offset_2, - 21U, - slab_region + arena_sizes.x * 3U, - md_bm_region + arena_sizes.y * 3U, - md_region + arena_sizes.w * 3U, - size_classes + 96U, + (size_t)21U, + slab_region + arena_sizes.x * (size_t)3U, + md_bm_region + arena_sizes.y * (size_t)3U, + md_region + arena_sizes.w * (size_t)3U, + size_classes + (size_t)96U, sizes); init_size_class(offset_2, - 22U, - slab_region + arena_sizes.x * 3U, - md_bm_region + arena_sizes.y * 3U, - md_region + arena_sizes.w * 3U, - size_classes + 96U, + (size_t)22U, + slab_region + arena_sizes.x * (size_t)3U, + md_bm_region + arena_sizes.y * (size_t)3U, + md_region + arena_sizes.w * (size_t)3U, + size_classes + (size_t)96U, sizes); init_size_class(offset_2, - 23U, - slab_region + arena_sizes.x * 3U, - md_bm_region + arena_sizes.y * 3U, - md_region + arena_sizes.w * 3U, - size_classes + 96U, + (size_t)23U, + slab_region + arena_sizes.x * (size_t)3U, + md_bm_region + arena_sizes.y * (size_t)3U, + md_region + arena_sizes.w * (size_t)3U, + size_classes + (size_t)96U, sizes); init_size_class(offset_2, - 24U, - slab_region + arena_sizes.x * 3U, - md_bm_region + arena_sizes.y * 3U, - md_region + arena_sizes.w * 3U, - size_classes + 96U, + (size_t)24U, + slab_region + arena_sizes.x * (size_t)3U, + md_bm_region + arena_sizes.y * (size_t)3U, + md_region + arena_sizes.w * (size_t)3U, + size_classes + (size_t)96U, sizes); init_size_class(offset_2, - 25U, - slab_region + arena_sizes.x * 3U, - md_bm_region + arena_sizes.y * 3U, - md_region + arena_sizes.w * 3U, - size_classes + 96U, + (size_t)25U, + slab_region + arena_sizes.x * (size_t)3U, + md_bm_region + arena_sizes.y * (size_t)3U, + md_region + arena_sizes.w * (size_t)3U, + size_classes + (size_t)96U, sizes); init_size_class(offset_2, - 26U, - slab_region + arena_sizes.x * 3U, - md_bm_region + arena_sizes.y * 3U, - md_region + arena_sizes.w * 3U, - size_classes + 96U, - sizes); - init_size_class2(offset_2 + 27U, - 0U, - slab_region + arena_sizes.x * 3U + 16777216U * (size_t)4096U * 27U, - md_bm_region_b + arena_sizes.z * 3U, - md_region + arena_sizes.w * 3U + 452984832U, - size_classes + 96U + 27U, - sizes); - init_size_class2(offset_2 + 27U, - 1U, - slab_region + arena_sizes.x * 3U + 16777216U * (size_t)4096U * 27U, - md_bm_region_b + arena_sizes.z * 3U, - md_region + arena_sizes.w * 3U + 452984832U, - size_classes + 96U + 27U, - sizes); - init_size_class2(offset_2 + 27U, - 2U, - slab_region + arena_sizes.x * 3U + 16777216U * (size_t)4096U * 27U, - md_bm_region_b + arena_sizes.z * 3U, - md_region + arena_sizes.w * 3U + 452984832U, - size_classes + 96U + 27U, - sizes); - init_size_class2(offset_2 + 27U, - 3U, - slab_region + arena_sizes.x * 3U + 16777216U * (size_t)4096U * 27U, - md_bm_region_b + arena_sizes.z * 3U, - md_region + arena_sizes.w * 3U + 452984832U, - size_classes + 96U + 27U, - sizes); - init_size_class2(offset_2 + 27U, - 4U, - slab_region + arena_sizes.x * 3U + 16777216U * (size_t)4096U * 27U, - md_bm_region_b + arena_sizes.z * 3U, - md_region + arena_sizes.w * 3U + 452984832U, - size_classes + 96U + 27U, + (size_t)26U, + slab_region + arena_sizes.x * (size_t)3U, + md_bm_region + arena_sizes.y * (size_t)3U, + md_region + arena_sizes.w * (size_t)3U, + size_classes + (size_t)96U, + sizes); + init_size_class2(offset_2 + (size_t)27U, + (size_t)0U, + slab_region + arena_sizes.x * (size_t)3U + (size_t)16777216U * (size_t)4096U * (size_t)27U, + md_bm_region_b + arena_sizes.z * (size_t)3U, + md_region + arena_sizes.w * (size_t)3U + (size_t)452984832U, + size_classes + (size_t)96U + (size_t)27U, + sizes); + init_size_class2(offset_2 + (size_t)27U, + (size_t)1U, + slab_region + arena_sizes.x * (size_t)3U + (size_t)16777216U * (size_t)4096U * (size_t)27U, + md_bm_region_b + arena_sizes.z * (size_t)3U, + md_region + arena_sizes.w * (size_t)3U + (size_t)452984832U, + size_classes + (size_t)96U + (size_t)27U, + sizes); + init_size_class2(offset_2 + (size_t)27U, + (size_t)2U, + slab_region + arena_sizes.x * (size_t)3U + (size_t)16777216U * (size_t)4096U * (size_t)27U, + md_bm_region_b + arena_sizes.z * (size_t)3U, + md_region + arena_sizes.w * (size_t)3U + (size_t)452984832U, + size_classes + (size_t)96U + (size_t)27U, + sizes); + init_size_class2(offset_2 + (size_t)27U, + (size_t)3U, + slab_region + arena_sizes.x * (size_t)3U + (size_t)16777216U * (size_t)4096U * (size_t)27U, + md_bm_region_b + arena_sizes.z * (size_t)3U, + md_region + arena_sizes.w * (size_t)3U + (size_t)452984832U, + size_classes + (size_t)96U + (size_t)27U, + sizes); + init_size_class2(offset_2 + (size_t)27U, + (size_t)4U, + slab_region + arena_sizes.x * (size_t)3U + (size_t)16777216U * (size_t)4096U * (size_t)27U, + md_bm_region_b + arena_sizes.z * (size_t)3U, + md_region + arena_sizes.w * (size_t)3U + (size_t)452984832U, + size_classes + (size_t)96U + (size_t)27U, sizes); return ((Main_Meta_size_classes_all){ .size_classes = size_classes, .slab_region = slab_region }); @@ -2417,10 +2422,11 @@ static uint8_t *slab_malloc(size_t arena_id, uint32_t bytes) { uint32_t r0 = SizeClassSelection_inv_impl(32768U, 7U, bytes + 2U); size_t i = (size_t)r0; - Constants_sc_union size = sizes[arena_id * 32U + i]; - Steel_SpinLock_acquire(&Main_Meta_sc_all.size_classes[arena_id * 32U + i].lock); - uint8_t *r = allocate_size_class(Main_Meta_sc_all.size_classes[arena_id * 32U + i].data); - Steel_SpinLock_release(&Main_Meta_sc_all.size_classes[arena_id * 32U + i].lock); + Constants_sc_union size = sizes[arena_id * (size_t)32U + i]; + Steel_SpinLock_acquire(&Main_Meta_sc_all.size_classes[arena_id * (size_t)32U + i].lock); + uint8_t + *r = allocate_size_class(Main_Meta_sc_all.size_classes[arena_id * (size_t)32U + i].data); + Steel_SpinLock_release(&Main_Meta_sc_all.size_classes[arena_id * (size_t)32U + i].lock); uint8_t *ptr = r; uint8_t *ptr0 = ptr; uint32_t size1; @@ -2440,7 +2446,7 @@ static uint8_t *slab_malloc(size_t arena_id, uint32_t bytes) static uint8_t *slab_aligned_alloc(size_t arena_id, uint32_t alignment, uint32_t bytes) { - Constants_sc_union size = sizes[arena_id * 32U + 0U]; + Constants_sc_union size = sizes[arena_id * (size_t)32U + (size_t)0U]; uint32_t size_; if (size.tag == Constants_Sc) size_ = size.case_Sc; @@ -2451,9 +2457,11 @@ static uint8_t *slab_aligned_alloc(size_t arena_id, uint32_t alignment, uint32_t bool b = 131072U % size_ == 0U; if (b && bytes <= size_ - 2U && alignment <= size_) { - Steel_SpinLock_acquire(&Main_Meta_sc_all.size_classes[arena_id * 32U + 0U].lock); - uint8_t *r = allocate_size_class(Main_Meta_sc_all.size_classes[arena_id * 32U + 0U].data); - Steel_SpinLock_release(&Main_Meta_sc_all.size_classes[arena_id * 32U + 0U].lock); + Steel_SpinLock_acquire(&Main_Meta_sc_all.size_classes[arena_id * (size_t)32U + (size_t)0U].lock); + uint8_t + *r = + allocate_size_class(Main_Meta_sc_all.size_classes[arena_id * (size_t)32U + (size_t)0U].data); + Steel_SpinLock_release(&Main_Meta_sc_all.size_classes[arena_id * (size_t)32U + (size_t)0U].lock); uint8_t *ptr = r; uint8_t *ptr0 = ptr; uint32_t size1; @@ -2472,7 +2480,7 @@ static uint8_t *slab_aligned_alloc(size_t arena_id, uint32_t alignment, uint32_t } else { - Constants_sc_union size1 = sizes[arena_id * 32U + 1U]; + Constants_sc_union size1 = sizes[arena_id * (size_t)32U + (size_t)1U]; uint32_t size_1; if (size1.tag == Constants_Sc) size_1 = size1.case_Sc; @@ -2483,9 +2491,15 @@ static uint8_t *slab_aligned_alloc(size_t arena_id, uint32_t alignment, uint32_t bool b1 = 131072U % size_1 == 0U; if (b1 && bytes <= size_1 - 2U && alignment <= size_1) { - Steel_SpinLock_acquire(&Main_Meta_sc_all.size_classes[arena_id * 32U + 1U].lock); - uint8_t *r = allocate_size_class(Main_Meta_sc_all.size_classes[arena_id * 32U + 1U].data); - Steel_SpinLock_release(&Main_Meta_sc_all.size_classes[arena_id * 32U + 1U].lock); + Steel_SpinLock_acquire(&Main_Meta_sc_all.size_classes[arena_id + * (size_t)32U + + (size_t)1U].lock); + uint8_t + *r = + allocate_size_class(Main_Meta_sc_all.size_classes[arena_id * (size_t)32U + (size_t)1U].data); + Steel_SpinLock_release(&Main_Meta_sc_all.size_classes[arena_id + * (size_t)32U + + (size_t)1U].lock); uint8_t *ptr = r; uint8_t *ptr0 = ptr; uint32_t size2; @@ -2504,7 +2518,7 @@ static uint8_t *slab_aligned_alloc(size_t arena_id, uint32_t alignment, uint32_t } else { - Constants_sc_union size2 = sizes[arena_id * 32U + 2U]; + Constants_sc_union size2 = sizes[arena_id * (size_t)32U + (size_t)2U]; uint32_t size_2; if (size2.tag == Constants_Sc) size_2 = size2.case_Sc; @@ -2515,9 +2529,17 @@ static uint8_t *slab_aligned_alloc(size_t arena_id, uint32_t alignment, uint32_t bool b2 = 131072U % size_2 == 0U; if (b2 && bytes <= size_2 - 2U && alignment <= size_2) { - Steel_SpinLock_acquire(&Main_Meta_sc_all.size_classes[arena_id * 32U + 2U].lock); - uint8_t *r = allocate_size_class(Main_Meta_sc_all.size_classes[arena_id * 32U + 2U].data); - Steel_SpinLock_release(&Main_Meta_sc_all.size_classes[arena_id * 32U + 2U].lock); + Steel_SpinLock_acquire(&Main_Meta_sc_all.size_classes[arena_id + * (size_t)32U + + (size_t)2U].lock); + uint8_t + *r = + allocate_size_class(Main_Meta_sc_all.size_classes[arena_id + * (size_t)32U + + (size_t)2U].data); + Steel_SpinLock_release(&Main_Meta_sc_all.size_classes[arena_id + * (size_t)32U + + (size_t)2U].lock); uint8_t *ptr = r; uint8_t *ptr0 = ptr; uint32_t size3; @@ -2536,7 +2558,7 @@ static uint8_t *slab_aligned_alloc(size_t arena_id, uint32_t alignment, uint32_t } else { - Constants_sc_union size3 = sizes[arena_id * 32U + 3U]; + Constants_sc_union size3 = sizes[arena_id * (size_t)32U + (size_t)3U]; uint32_t size_3; if (size3.tag == Constants_Sc) size_3 = size3.case_Sc; @@ -2547,9 +2569,17 @@ static uint8_t *slab_aligned_alloc(size_t arena_id, uint32_t alignment, uint32_t bool b3 = 131072U % size_3 == 0U; if (b3 && bytes <= size_3 - 2U && alignment <= size_3) { - Steel_SpinLock_acquire(&Main_Meta_sc_all.size_classes[arena_id * 32U + 3U].lock); - uint8_t *r = allocate_size_class(Main_Meta_sc_all.size_classes[arena_id * 32U + 3U].data); - Steel_SpinLock_release(&Main_Meta_sc_all.size_classes[arena_id * 32U + 3U].lock); + Steel_SpinLock_acquire(&Main_Meta_sc_all.size_classes[arena_id + * (size_t)32U + + (size_t)3U].lock); + uint8_t + *r = + allocate_size_class(Main_Meta_sc_all.size_classes[arena_id + * (size_t)32U + + (size_t)3U].data); + Steel_SpinLock_release(&Main_Meta_sc_all.size_classes[arena_id + * (size_t)32U + + (size_t)3U].lock); uint8_t *ptr = r; uint8_t *ptr0 = ptr; uint32_t size4; @@ -2568,7 +2598,7 @@ static uint8_t *slab_aligned_alloc(size_t arena_id, uint32_t alignment, uint32_t } else { - Constants_sc_union size4 = sizes[arena_id * 32U + 4U]; + Constants_sc_union size4 = sizes[arena_id * (size_t)32U + (size_t)4U]; uint32_t size_4; if (size4.tag == Constants_Sc) size_4 = size4.case_Sc; @@ -2579,10 +2609,17 @@ static uint8_t *slab_aligned_alloc(size_t arena_id, uint32_t alignment, uint32_t bool b4 = 131072U % size_4 == 0U; if (b4 && bytes <= size_4 - 2U && alignment <= size_4) { - Steel_SpinLock_acquire(&Main_Meta_sc_all.size_classes[arena_id * 32U + 4U].lock); + Steel_SpinLock_acquire(&Main_Meta_sc_all.size_classes[arena_id + * (size_t)32U + + (size_t)4U].lock); uint8_t - *r = allocate_size_class(Main_Meta_sc_all.size_classes[arena_id * 32U + 4U].data); - Steel_SpinLock_release(&Main_Meta_sc_all.size_classes[arena_id * 32U + 4U].lock); + *r = + allocate_size_class(Main_Meta_sc_all.size_classes[arena_id + * (size_t)32U + + (size_t)4U].data); + Steel_SpinLock_release(&Main_Meta_sc_all.size_classes[arena_id + * (size_t)32U + + (size_t)4U].lock); uint8_t *ptr = r; uint8_t *ptr0 = ptr; uint32_t size5; @@ -2601,7 +2638,7 @@ static uint8_t *slab_aligned_alloc(size_t arena_id, uint32_t alignment, uint32_t } else { - Constants_sc_union size5 = sizes[arena_id * 32U + 5U]; + Constants_sc_union size5 = sizes[arena_id * (size_t)32U + (size_t)5U]; uint32_t size_5; if (size5.tag == Constants_Sc) size_5 = size5.case_Sc; @@ -2612,10 +2649,17 @@ static uint8_t *slab_aligned_alloc(size_t arena_id, uint32_t alignment, uint32_t bool b5 = 131072U % size_5 == 0U; if (b5 && bytes <= size_5 - 2U && alignment <= size_5) { - Steel_SpinLock_acquire(&Main_Meta_sc_all.size_classes[arena_id * 32U + 5U].lock); + Steel_SpinLock_acquire(&Main_Meta_sc_all.size_classes[arena_id + * (size_t)32U + + (size_t)5U].lock); uint8_t - *r = allocate_size_class(Main_Meta_sc_all.size_classes[arena_id * 32U + 5U].data); - Steel_SpinLock_release(&Main_Meta_sc_all.size_classes[arena_id * 32U + 5U].lock); + *r = + allocate_size_class(Main_Meta_sc_all.size_classes[arena_id + * (size_t)32U + + (size_t)5U].data); + Steel_SpinLock_release(&Main_Meta_sc_all.size_classes[arena_id + * (size_t)32U + + (size_t)5U].lock); uint8_t *ptr = r; uint8_t *ptr0 = ptr; uint32_t size6; @@ -2634,7 +2678,7 @@ static uint8_t *slab_aligned_alloc(size_t arena_id, uint32_t alignment, uint32_t } else { - Constants_sc_union size6 = sizes[arena_id * 32U + 6U]; + Constants_sc_union size6 = sizes[arena_id * (size_t)32U + (size_t)6U]; uint32_t size_6; if (size6.tag == Constants_Sc) size_6 = size6.case_Sc; @@ -2645,10 +2689,17 @@ static uint8_t *slab_aligned_alloc(size_t arena_id, uint32_t alignment, uint32_t bool b6 = 131072U % size_6 == 0U; if (b6 && bytes <= size_6 - 2U && alignment <= size_6) { - Steel_SpinLock_acquire(&Main_Meta_sc_all.size_classes[arena_id * 32U + 6U].lock); + Steel_SpinLock_acquire(&Main_Meta_sc_all.size_classes[arena_id + * (size_t)32U + + (size_t)6U].lock); uint8_t - *r = allocate_size_class(Main_Meta_sc_all.size_classes[arena_id * 32U + 6U].data); - Steel_SpinLock_release(&Main_Meta_sc_all.size_classes[arena_id * 32U + 6U].lock); + *r = + allocate_size_class(Main_Meta_sc_all.size_classes[arena_id + * (size_t)32U + + (size_t)6U].data); + Steel_SpinLock_release(&Main_Meta_sc_all.size_classes[arena_id + * (size_t)32U + + (size_t)6U].lock); uint8_t *ptr = r; uint8_t *ptr0 = ptr; uint32_t size7; @@ -2669,7 +2720,7 @@ static uint8_t *slab_aligned_alloc(size_t arena_id, uint32_t alignment, uint32_t } else { - Constants_sc_union size7 = sizes[arena_id * 32U + 7U]; + Constants_sc_union size7 = sizes[arena_id * (size_t)32U + (size_t)7U]; uint32_t size_7; if (size7.tag == Constants_Sc) size_7 = size7.case_Sc; @@ -2682,10 +2733,17 @@ static uint8_t *slab_aligned_alloc(size_t arena_id, uint32_t alignment, uint32_t bool b7 = 131072U % size_7 == 0U; if (b7 && bytes <= size_7 - 2U && alignment <= size_7) { - Steel_SpinLock_acquire(&Main_Meta_sc_all.size_classes[arena_id * 32U + 7U].lock); + Steel_SpinLock_acquire(&Main_Meta_sc_all.size_classes[arena_id + * (size_t)32U + + (size_t)7U].lock); uint8_t - *r = allocate_size_class(Main_Meta_sc_all.size_classes[arena_id * 32U + 7U].data); - Steel_SpinLock_release(&Main_Meta_sc_all.size_classes[arena_id * 32U + 7U].lock); + *r = + allocate_size_class(Main_Meta_sc_all.size_classes[arena_id + * (size_t)32U + + (size_t)7U].data); + Steel_SpinLock_release(&Main_Meta_sc_all.size_classes[arena_id + * (size_t)32U + + (size_t)7U].lock); uint8_t *ptr = r; uint8_t *ptr0 = ptr; uint32_t size8; @@ -2706,7 +2764,7 @@ static uint8_t *slab_aligned_alloc(size_t arena_id, uint32_t alignment, uint32_t } else { - Constants_sc_union size8 = sizes[arena_id * 32U + 8U]; + Constants_sc_union size8 = sizes[arena_id * (size_t)32U + (size_t)8U]; uint32_t size_8; if (size8.tag == Constants_Sc) size_8 = size8.case_Sc; @@ -2719,11 +2777,17 @@ static uint8_t *slab_aligned_alloc(size_t arena_id, uint32_t alignment, uint32_t bool b8 = 131072U % size_8 == 0U; if (b8 && bytes <= size_8 - 2U && alignment <= size_8) { - Steel_SpinLock_acquire(&Main_Meta_sc_all.size_classes[arena_id * 32U + 8U].lock); + Steel_SpinLock_acquire(&Main_Meta_sc_all.size_classes[arena_id + * (size_t)32U + + (size_t)8U].lock); uint8_t *r = - allocate_size_class(Main_Meta_sc_all.size_classes[arena_id * 32U + 8U].data); - Steel_SpinLock_release(&Main_Meta_sc_all.size_classes[arena_id * 32U + 8U].lock); + allocate_size_class(Main_Meta_sc_all.size_classes[arena_id + * (size_t)32U + + (size_t)8U].data); + Steel_SpinLock_release(&Main_Meta_sc_all.size_classes[arena_id + * (size_t)32U + + (size_t)8U].lock); uint8_t *ptr = r; uint8_t *ptr0 = ptr; uint32_t size9; @@ -2744,7 +2808,7 @@ static uint8_t *slab_aligned_alloc(size_t arena_id, uint32_t alignment, uint32_t } else { - Constants_sc_union size9 = sizes[arena_id * 32U + 9U]; + Constants_sc_union size9 = sizes[arena_id * (size_t)32U + (size_t)9U]; uint32_t size_9; if (size9.tag == Constants_Sc) size_9 = size9.case_Sc; @@ -2758,14 +2822,16 @@ static uint8_t *slab_aligned_alloc(size_t arena_id, uint32_t alignment, uint32_t if (b9 && bytes <= size_9 - 2U && alignment <= size_9) { Steel_SpinLock_acquire(&Main_Meta_sc_all.size_classes[arena_id - * 32U - + 9U].lock); + * (size_t)32U + + (size_t)9U].lock); uint8_t *r = - allocate_size_class(Main_Meta_sc_all.size_classes[arena_id * 32U + 9U].data); + allocate_size_class(Main_Meta_sc_all.size_classes[arena_id + * (size_t)32U + + (size_t)9U].data); Steel_SpinLock_release(&Main_Meta_sc_all.size_classes[arena_id - * 32U - + 9U].lock); + * (size_t)32U + + (size_t)9U].lock); uint8_t *ptr = r; uint8_t *ptr0 = ptr; uint32_t size10; @@ -2786,7 +2852,7 @@ static uint8_t *slab_aligned_alloc(size_t arena_id, uint32_t alignment, uint32_t } else { - Constants_sc_union size10 = sizes[arena_id * 32U + 10U]; + Constants_sc_union size10 = sizes[arena_id * (size_t)32U + (size_t)10U]; uint32_t size_10; if (size10.tag == Constants_Sc) size_10 = size10.case_Sc; @@ -2800,16 +2866,16 @@ static uint8_t *slab_aligned_alloc(size_t arena_id, uint32_t alignment, uint32_t if (b10 && bytes <= size_10 - 2U && alignment <= size_10) { Steel_SpinLock_acquire(&Main_Meta_sc_all.size_classes[arena_id - * 32U - + 10U].lock); + * (size_t)32U + + (size_t)10U].lock); uint8_t *r = allocate_size_class(Main_Meta_sc_all.size_classes[arena_id - * 32U - + 10U].data); + * (size_t)32U + + (size_t)10U].data); Steel_SpinLock_release(&Main_Meta_sc_all.size_classes[arena_id - * 32U - + 10U].lock); + * (size_t)32U + + (size_t)10U].lock); uint8_t *ptr = r; uint8_t *ptr0 = ptr; uint32_t size11; @@ -2830,7 +2896,7 @@ static uint8_t *slab_aligned_alloc(size_t arena_id, uint32_t alignment, uint32_t } else { - Constants_sc_union size11 = sizes[arena_id * 32U + 11U]; + Constants_sc_union size11 = sizes[arena_id * (size_t)32U + (size_t)11U]; uint32_t size_11; if (size11.tag == Constants_Sc) size_11 = size11.case_Sc; @@ -2844,16 +2910,16 @@ static uint8_t *slab_aligned_alloc(size_t arena_id, uint32_t alignment, uint32_t if (b11 && bytes <= size_11 - 2U && alignment <= size_11) { Steel_SpinLock_acquire(&Main_Meta_sc_all.size_classes[arena_id - * 32U - + 11U].lock); + * (size_t)32U + + (size_t)11U].lock); uint8_t *r = allocate_size_class(Main_Meta_sc_all.size_classes[arena_id - * 32U - + 11U].data); + * (size_t)32U + + (size_t)11U].data); Steel_SpinLock_release(&Main_Meta_sc_all.size_classes[arena_id - * 32U - + 11U].lock); + * (size_t)32U + + (size_t)11U].lock); uint8_t *ptr = r; uint8_t *ptr0 = ptr; uint32_t size12; @@ -2874,7 +2940,7 @@ static uint8_t *slab_aligned_alloc(size_t arena_id, uint32_t alignment, uint32_t } else { - Constants_sc_union size12 = sizes[arena_id * 32U + 12U]; + Constants_sc_union size12 = sizes[arena_id * (size_t)32U + (size_t)12U]; uint32_t size_12; if (size12.tag == Constants_Sc) size_12 = size12.case_Sc; @@ -2888,16 +2954,16 @@ static uint8_t *slab_aligned_alloc(size_t arena_id, uint32_t alignment, uint32_t if (b12 && bytes <= size_12 - 2U && alignment <= size_12) { Steel_SpinLock_acquire(&Main_Meta_sc_all.size_classes[arena_id - * 32U - + 12U].lock); + * (size_t)32U + + (size_t)12U].lock); uint8_t *r = allocate_size_class(Main_Meta_sc_all.size_classes[arena_id - * 32U - + 12U].data); + * (size_t)32U + + (size_t)12U].data); Steel_SpinLock_release(&Main_Meta_sc_all.size_classes[arena_id - * 32U - + 12U].lock); + * (size_t)32U + + (size_t)12U].lock); uint8_t *ptr = r; uint8_t *ptr0 = ptr; uint32_t size13; @@ -2918,7 +2984,7 @@ static uint8_t *slab_aligned_alloc(size_t arena_id, uint32_t alignment, uint32_t } else { - Constants_sc_union size13 = sizes[arena_id * 32U + 13U]; + Constants_sc_union size13 = sizes[arena_id * (size_t)32U + (size_t)13U]; uint32_t size_13; if (size13.tag == Constants_Sc) size_13 = size13.case_Sc; @@ -2932,16 +2998,16 @@ static uint8_t *slab_aligned_alloc(size_t arena_id, uint32_t alignment, uint32_t if (b13 && bytes <= size_13 - 2U && alignment <= size_13) { Steel_SpinLock_acquire(&Main_Meta_sc_all.size_classes[arena_id - * 32U - + 13U].lock); + * (size_t)32U + + (size_t)13U].lock); uint8_t *r = allocate_size_class(Main_Meta_sc_all.size_classes[arena_id - * 32U - + 13U].data); + * (size_t)32U + + (size_t)13U].data); Steel_SpinLock_release(&Main_Meta_sc_all.size_classes[arena_id - * 32U - + 13U].lock); + * (size_t)32U + + (size_t)13U].lock); uint8_t *ptr = r; uint8_t *ptr0 = ptr; uint32_t size14; @@ -2962,7 +3028,8 @@ static uint8_t *slab_aligned_alloc(size_t arena_id, uint32_t alignment, uint32_t } else { - Constants_sc_union size14 = sizes[arena_id * 32U + 14U]; + Constants_sc_union + size14 = sizes[arena_id * (size_t)32U + (size_t)14U]; uint32_t size_14; if (size14.tag == Constants_Sc) size_14 = size14.case_Sc; @@ -2976,16 +3043,16 @@ static uint8_t *slab_aligned_alloc(size_t arena_id, uint32_t alignment, uint32_t if (b14 && bytes <= size_14 - 2U && alignment <= size_14) { Steel_SpinLock_acquire(&Main_Meta_sc_all.size_classes[arena_id - * 32U - + 14U].lock); + * (size_t)32U + + (size_t)14U].lock); uint8_t *r = allocate_size_class(Main_Meta_sc_all.size_classes[arena_id - * 32U - + 14U].data); + * (size_t)32U + + (size_t)14U].data); Steel_SpinLock_release(&Main_Meta_sc_all.size_classes[arena_id - * 32U - + 14U].lock); + * (size_t)32U + + (size_t)14U].lock); uint8_t *ptr = r; uint8_t *ptr0 = ptr; uint32_t size15; @@ -3006,7 +3073,8 @@ static uint8_t *slab_aligned_alloc(size_t arena_id, uint32_t alignment, uint32_t } else { - Constants_sc_union size15 = sizes[arena_id * 32U + 15U]; + Constants_sc_union + size15 = sizes[arena_id * (size_t)32U + (size_t)15U]; uint32_t size_15; if (size15.tag == Constants_Sc) size_15 = size15.case_Sc; @@ -3020,16 +3088,16 @@ static uint8_t *slab_aligned_alloc(size_t arena_id, uint32_t alignment, uint32_t if (b15 && bytes <= size_15 - 2U && alignment <= size_15) { Steel_SpinLock_acquire(&Main_Meta_sc_all.size_classes[arena_id - * 32U - + 15U].lock); + * (size_t)32U + + (size_t)15U].lock); uint8_t *r = allocate_size_class(Main_Meta_sc_all.size_classes[arena_id - * 32U - + 15U].data); + * (size_t)32U + + (size_t)15U].data); Steel_SpinLock_release(&Main_Meta_sc_all.size_classes[arena_id - * 32U - + 15U].lock); + * (size_t)32U + + (size_t)15U].lock); uint8_t *ptr = r; uint8_t *ptr0 = ptr; uint32_t size16; @@ -3050,7 +3118,8 @@ static uint8_t *slab_aligned_alloc(size_t arena_id, uint32_t alignment, uint32_t } else { - Constants_sc_union size16 = sizes[arena_id * 32U + 16U]; + Constants_sc_union + size16 = sizes[arena_id * (size_t)32U + (size_t)16U]; uint32_t size_16; if (size16.tag == Constants_Sc) size_16 = size16.case_Sc; @@ -3064,16 +3133,16 @@ static uint8_t *slab_aligned_alloc(size_t arena_id, uint32_t alignment, uint32_t if (b16 && bytes <= size_16 - 2U && alignment <= size_16) { Steel_SpinLock_acquire(&Main_Meta_sc_all.size_classes[arena_id - * 32U - + 16U].lock); + * (size_t)32U + + (size_t)16U].lock); uint8_t *r = allocate_size_class(Main_Meta_sc_all.size_classes[arena_id - * 32U - + 16U].data); + * (size_t)32U + + (size_t)16U].data); Steel_SpinLock_release(&Main_Meta_sc_all.size_classes[arena_id - * 32U - + 16U].lock); + * (size_t)32U + + (size_t)16U].lock); uint8_t *ptr = r; uint8_t *ptr0 = ptr; uint32_t size17; @@ -3094,7 +3163,8 @@ static uint8_t *slab_aligned_alloc(size_t arena_id, uint32_t alignment, uint32_t } else { - Constants_sc_union size17 = sizes[arena_id * 32U + 17U]; + Constants_sc_union + size17 = sizes[arena_id * (size_t)32U + (size_t)17U]; uint32_t size_17; if (size17.tag == Constants_Sc) size_17 = size17.case_Sc; @@ -3108,16 +3178,16 @@ static uint8_t *slab_aligned_alloc(size_t arena_id, uint32_t alignment, uint32_t if (b17 && bytes <= size_17 - 2U && alignment <= size_17) { Steel_SpinLock_acquire(&Main_Meta_sc_all.size_classes[arena_id - * 32U - + 17U].lock); + * (size_t)32U + + (size_t)17U].lock); uint8_t *r = allocate_size_class(Main_Meta_sc_all.size_classes[arena_id - * 32U - + 17U].data); + * (size_t)32U + + (size_t)17U].data); Steel_SpinLock_release(&Main_Meta_sc_all.size_classes[arena_id - * 32U - + 17U].lock); + * (size_t)32U + + (size_t)17U].lock); uint8_t *ptr = r; uint8_t *ptr0 = ptr; uint32_t size18; @@ -3138,7 +3208,8 @@ static uint8_t *slab_aligned_alloc(size_t arena_id, uint32_t alignment, uint32_t } else { - Constants_sc_union size18 = sizes[arena_id * 32U + 18U]; + Constants_sc_union + size18 = sizes[arena_id * (size_t)32U + (size_t)18U]; uint32_t size_18; if (size18.tag == Constants_Sc) size_18 = size18.case_Sc; @@ -3152,16 +3223,16 @@ static uint8_t *slab_aligned_alloc(size_t arena_id, uint32_t alignment, uint32_t if (b18 && bytes <= size_18 - 2U && alignment <= size_18) { Steel_SpinLock_acquire(&Main_Meta_sc_all.size_classes[arena_id - * 32U - + 18U].lock); + * (size_t)32U + + (size_t)18U].lock); uint8_t *r = allocate_size_class(Main_Meta_sc_all.size_classes[arena_id - * 32U - + 18U].data); + * (size_t)32U + + (size_t)18U].data); Steel_SpinLock_release(&Main_Meta_sc_all.size_classes[arena_id - * 32U - + 18U].lock); + * (size_t)32U + + (size_t)18U].lock); uint8_t *ptr = r; uint8_t *ptr0 = ptr; uint32_t size19; @@ -3182,7 +3253,8 @@ static uint8_t *slab_aligned_alloc(size_t arena_id, uint32_t alignment, uint32_t } else { - Constants_sc_union size19 = sizes[arena_id * 32U + 19U]; + Constants_sc_union + size19 = sizes[arena_id * (size_t)32U + (size_t)19U]; uint32_t size_19; if (size19.tag == Constants_Sc) size_19 = size19.case_Sc; @@ -3196,16 +3268,16 @@ static uint8_t *slab_aligned_alloc(size_t arena_id, uint32_t alignment, uint32_t if (b19 && bytes <= size_19 - 2U && alignment <= size_19) { Steel_SpinLock_acquire(&Main_Meta_sc_all.size_classes[arena_id - * 32U - + 19U].lock); + * (size_t)32U + + (size_t)19U].lock); uint8_t *r = allocate_size_class(Main_Meta_sc_all.size_classes[arena_id - * 32U - + 19U].data); + * (size_t)32U + + (size_t)19U].data); Steel_SpinLock_release(&Main_Meta_sc_all.size_classes[arena_id - * 32U - + 19U].lock); + * (size_t)32U + + (size_t)19U].lock); uint8_t *ptr = r; uint8_t *ptr0 = ptr; uint32_t size20; @@ -3226,7 +3298,8 @@ static uint8_t *slab_aligned_alloc(size_t arena_id, uint32_t alignment, uint32_t } else { - Constants_sc_union size20 = sizes[arena_id * 32U + 20U]; + Constants_sc_union + size20 = sizes[arena_id * (size_t)32U + (size_t)20U]; uint32_t size_20; if (size20.tag == Constants_Sc) size_20 = size20.case_Sc; @@ -3240,16 +3313,16 @@ static uint8_t *slab_aligned_alloc(size_t arena_id, uint32_t alignment, uint32_t if (b20 && bytes <= size_20 - 2U && alignment <= size_20) { Steel_SpinLock_acquire(&Main_Meta_sc_all.size_classes[arena_id - * 32U - + 20U].lock); + * (size_t)32U + + (size_t)20U].lock); uint8_t *r = allocate_size_class(Main_Meta_sc_all.size_classes[arena_id - * 32U - + 20U].data); + * (size_t)32U + + (size_t)20U].data); Steel_SpinLock_release(&Main_Meta_sc_all.size_classes[arena_id - * 32U - + 20U].lock); + * (size_t)32U + + (size_t)20U].lock); uint8_t *ptr = r; uint8_t *ptr0 = ptr; uint32_t size21; @@ -3270,7 +3343,8 @@ static uint8_t *slab_aligned_alloc(size_t arena_id, uint32_t alignment, uint32_t } else { - Constants_sc_union size21 = sizes[arena_id * 32U + 21U]; + Constants_sc_union + size21 = sizes[arena_id * (size_t)32U + (size_t)21U]; uint32_t size_21; if (size21.tag == Constants_Sc) size_21 = size21.case_Sc; @@ -3285,16 +3359,16 @@ static uint8_t *slab_aligned_alloc(size_t arena_id, uint32_t alignment, uint32_t (b21 && bytes <= size_21 - 2U && alignment <= size_21) { Steel_SpinLock_acquire(&Main_Meta_sc_all.size_classes[arena_id - * 32U - + 21U].lock); + * (size_t)32U + + (size_t)21U].lock); uint8_t *r = allocate_size_class(Main_Meta_sc_all.size_classes[arena_id - * 32U - + 21U].data); + * (size_t)32U + + (size_t)21U].data); Steel_SpinLock_release(&Main_Meta_sc_all.size_classes[arena_id - * 32U - + 21U].lock); + * (size_t)32U + + (size_t)21U].lock); uint8_t *ptr = r; uint8_t *ptr0 = ptr; uint32_t size22; @@ -3316,7 +3390,7 @@ static uint8_t *slab_aligned_alloc(size_t arena_id, uint32_t alignment, uint32_t else { Constants_sc_union - size22 = sizes[arena_id * 32U + 22U]; + size22 = sizes[arena_id * (size_t)32U + (size_t)22U]; uint32_t size_22; if (size22.tag == Constants_Sc) size_22 = size22.case_Sc; @@ -3331,16 +3405,16 @@ static uint8_t *slab_aligned_alloc(size_t arena_id, uint32_t alignment, uint32_t (b22 && bytes <= size_22 - 2U && alignment <= size_22) { Steel_SpinLock_acquire(&Main_Meta_sc_all.size_classes[arena_id - * 32U - + 22U].lock); + * (size_t)32U + + (size_t)22U].lock); uint8_t *r = allocate_size_class(Main_Meta_sc_all.size_classes[arena_id - * 32U - + 22U].data); + * (size_t)32U + + (size_t)22U].data); Steel_SpinLock_release(&Main_Meta_sc_all.size_classes[arena_id - * 32U - + 22U].lock); + * (size_t)32U + + (size_t)22U].lock); uint8_t *ptr = r; uint8_t *ptr0 = ptr; uint32_t size23; @@ -3362,7 +3436,7 @@ static uint8_t *slab_aligned_alloc(size_t arena_id, uint32_t alignment, uint32_t else { Constants_sc_union - size23 = sizes[arena_id * 32U + 23U]; + size23 = sizes[arena_id * (size_t)32U + (size_t)23U]; uint32_t size_23; if (size23.tag == Constants_Sc) size_23 = size23.case_Sc; @@ -3381,16 +3455,16 @@ static uint8_t *slab_aligned_alloc(size_t arena_id, uint32_t alignment, uint32_t ) { Steel_SpinLock_acquire(&Main_Meta_sc_all.size_classes[arena_id - * 32U - + 23U].lock); + * (size_t)32U + + (size_t)23U].lock); uint8_t *r = allocate_size_class(Main_Meta_sc_all.size_classes[arena_id - * 32U - + 23U].data); + * (size_t)32U + + (size_t)23U].data); Steel_SpinLock_release(&Main_Meta_sc_all.size_classes[arena_id - * 32U - + 23U].lock); + * (size_t)32U + + (size_t)23U].lock); uint8_t *ptr = r; uint8_t *ptr0 = ptr; uint32_t size24; @@ -3412,7 +3486,10 @@ static uint8_t *slab_aligned_alloc(size_t arena_id, uint32_t alignment, uint32_t else { Constants_sc_union - size24 = sizes[arena_id * 32U + 24U]; + size24 = + sizes[arena_id + * (size_t)32U + + (size_t)24U]; uint32_t size_24; if (size24.tag == Constants_Sc) size_24 = size24.case_Sc; @@ -3431,16 +3508,16 @@ static uint8_t *slab_aligned_alloc(size_t arena_id, uint32_t alignment, uint32_t ) { Steel_SpinLock_acquire(&Main_Meta_sc_all.size_classes[arena_id - * 32U - + 24U].lock); + * (size_t)32U + + (size_t)24U].lock); uint8_t *r = allocate_size_class(Main_Meta_sc_all.size_classes[arena_id - * 32U - + 24U].data); + * (size_t)32U + + (size_t)24U].data); Steel_SpinLock_release(&Main_Meta_sc_all.size_classes[arena_id - * 32U - + 24U].lock); + * (size_t)32U + + (size_t)24U].lock); uint8_t *ptr = r; uint8_t *ptr0 = ptr; uint32_t size25; @@ -3462,7 +3539,10 @@ static uint8_t *slab_aligned_alloc(size_t arena_id, uint32_t alignment, uint32_t else { Constants_sc_union - size25 = sizes[arena_id * 32U + 25U]; + size25 = + sizes[arena_id + * (size_t)32U + + (size_t)25U]; uint32_t size_25; if (size25.tag == Constants_Sc) size_25 = size25.case_Sc; @@ -3481,16 +3561,16 @@ static uint8_t *slab_aligned_alloc(size_t arena_id, uint32_t alignment, uint32_t ) { Steel_SpinLock_acquire(&Main_Meta_sc_all.size_classes[arena_id - * 32U - + 25U].lock); + * (size_t)32U + + (size_t)25U].lock); uint8_t *r = allocate_size_class(Main_Meta_sc_all.size_classes[arena_id - * 32U - + 25U].data); + * (size_t)32U + + (size_t)25U].data); Steel_SpinLock_release(&Main_Meta_sc_all.size_classes[arena_id - * 32U - + 25U].lock); + * (size_t)32U + + (size_t)25U].lock); uint8_t *ptr = r; uint8_t *ptr0 = ptr; uint32_t size26; @@ -3512,7 +3592,10 @@ static uint8_t *slab_aligned_alloc(size_t arena_id, uint32_t alignment, uint32_t else { Constants_sc_union - size26 = sizes[arena_id * 32U + 26U]; + size26 = + sizes[arena_id + * (size_t)32U + + (size_t)26U]; uint32_t size_26; if (size26.tag == Constants_Sc) size_26 = size26.case_Sc; @@ -3531,16 +3614,16 @@ static uint8_t *slab_aligned_alloc(size_t arena_id, uint32_t alignment, uint32_t ) { Steel_SpinLock_acquire(&Main_Meta_sc_all.size_classes[arena_id - * 32U - + 26U].lock); + * (size_t)32U + + (size_t)26U].lock); uint8_t *r = allocate_size_class(Main_Meta_sc_all.size_classes[arena_id - * 32U - + 26U].data); + * (size_t)32U + + (size_t)26U].data); Steel_SpinLock_release(&Main_Meta_sc_all.size_classes[arena_id - * 32U - + 26U].lock); + * (size_t)32U + + (size_t)26U].lock); uint8_t *ptr = r; uint8_t *ptr0 = ptr; uint32_t size27; @@ -3562,7 +3645,10 @@ static uint8_t *slab_aligned_alloc(size_t arena_id, uint32_t alignment, uint32_t else { Constants_sc_union - size27 = sizes[arena_id * 32U + 27U]; + size27 = + sizes[arena_id + * (size_t)32U + + (size_t)27U]; uint32_t size_27; if (size27.tag == Constants_Sc) size_27 = size27.case_Sc; @@ -3581,16 +3667,16 @@ static uint8_t *slab_aligned_alloc(size_t arena_id, uint32_t alignment, uint32_t ) { Steel_SpinLock_acquire(&Main_Meta_sc_all.size_classes[arena_id - * 32U - + 27U].lock); + * (size_t)32U + + (size_t)27U].lock); uint8_t *r = allocate_size_class(Main_Meta_sc_all.size_classes[arena_id - * 32U - + 27U].data); + * (size_t)32U + + (size_t)27U].data); Steel_SpinLock_release(&Main_Meta_sc_all.size_classes[arena_id - * 32U - + 27U].lock); + * (size_t)32U + + (size_t)27U].lock); uint8_t *ptr = r; uint8_t *ptr0 = ptr; uint32_t size28; @@ -3612,7 +3698,10 @@ static uint8_t *slab_aligned_alloc(size_t arena_id, uint32_t alignment, uint32_t else { Constants_sc_union - size28 = sizes[arena_id * 32U + 28U]; + size28 = + sizes[arena_id + * (size_t)32U + + (size_t)28U]; uint32_t size_28; if (size28.tag == Constants_Sc) size_28 = size28.case_Sc; @@ -3631,16 +3720,16 @@ static uint8_t *slab_aligned_alloc(size_t arena_id, uint32_t alignment, uint32_t ) { Steel_SpinLock_acquire(&Main_Meta_sc_all.size_classes[arena_id - * 32U - + 28U].lock); + * (size_t)32U + + (size_t)28U].lock); uint8_t *r = allocate_size_class(Main_Meta_sc_all.size_classes[arena_id - * 32U - + 28U].data); + * (size_t)32U + + (size_t)28U].data); Steel_SpinLock_release(&Main_Meta_sc_all.size_classes[arena_id - * 32U - + 28U].lock); + * (size_t)32U + + (size_t)28U].lock); uint8_t *ptr = r; uint8_t *ptr0 = ptr; uint32_t size29; @@ -3662,7 +3751,10 @@ static uint8_t *slab_aligned_alloc(size_t arena_id, uint32_t alignment, uint32_t else { Constants_sc_union - size29 = sizes[arena_id * 32U + 29U]; + size29 = + sizes[arena_id + * (size_t)32U + + (size_t)29U]; uint32_t size_29; if (size29.tag == Constants_Sc) size_29 = size29.case_Sc; @@ -3681,16 +3773,16 @@ static uint8_t *slab_aligned_alloc(size_t arena_id, uint32_t alignment, uint32_t ) { Steel_SpinLock_acquire(&Main_Meta_sc_all.size_classes[arena_id - * 32U - + 29U].lock); + * (size_t)32U + + (size_t)29U].lock); uint8_t *r = allocate_size_class(Main_Meta_sc_all.size_classes[arena_id - * 32U - + 29U].data); + * (size_t)32U + + (size_t)29U].data); Steel_SpinLock_release(&Main_Meta_sc_all.size_classes[arena_id - * 32U - + 29U].lock); + * (size_t)32U + + (size_t)29U].lock); uint8_t *ptr = r; uint8_t *ptr0 = ptr; uint32_t size30; @@ -3713,7 +3805,10 @@ static uint8_t *slab_aligned_alloc(size_t arena_id, uint32_t alignment, uint32_t else { Constants_sc_union - size30 = sizes[arena_id * 32U + 30U]; + size30 = + sizes[arena_id + * (size_t)32U + + (size_t)30U]; uint32_t size_30; if (size30.tag == Constants_Sc) size_30 = size30.case_Sc; @@ -3733,16 +3828,16 @@ static uint8_t *slab_aligned_alloc(size_t arena_id, uint32_t alignment, uint32_t ) { Steel_SpinLock_acquire(&Main_Meta_sc_all.size_classes[arena_id - * 32U - + 30U].lock); + * (size_t)32U + + (size_t)30U].lock); uint8_t *r = allocate_size_class(Main_Meta_sc_all.size_classes[arena_id - * 32U - + 30U].data); + * (size_t)32U + + (size_t)30U].data); Steel_SpinLock_release(&Main_Meta_sc_all.size_classes[arena_id - * 32U - + 30U].lock); + * (size_t)32U + + (size_t)30U].lock); uint8_t *ptr = r; uint8_t *ptr0 = ptr; uint32_t size31; @@ -3765,7 +3860,10 @@ static uint8_t *slab_aligned_alloc(size_t arena_id, uint32_t alignment, uint32_t else { Constants_sc_union - size31 = sizes[arena_id * 32U + 31U]; + size31 = + sizes[arena_id + * (size_t)32U + + (size_t)31U]; uint32_t size_31; if (size31.tag == Constants_Sc) size_31 = size31.case_Sc; @@ -3785,16 +3883,16 @@ static uint8_t *slab_aligned_alloc(size_t arena_id, uint32_t alignment, uint32_t ) { Steel_SpinLock_acquire(&Main_Meta_sc_all.size_classes[arena_id - * 32U - + 31U].lock); + * (size_t)32U + + (size_t)31U].lock); uint8_t *r = allocate_size_class(Main_Meta_sc_all.size_classes[arena_id - * 32U - + 31U].data); + * (size_t)32U + + (size_t)31U].data); Steel_SpinLock_release(&Main_Meta_sc_all.size_classes[arena_id - * 32U - + 31U].lock); + * (size_t)32U + + (size_t)31U].lock); uint8_t *ptr = r; uint8_t *ptr0 = ptr; uint32_t size32; @@ -3857,20 +3955,28 @@ static size_t slab_getsize(uint8_t *ptr) uint8_t *pt1 = Main_Meta_sc_all.slab_region; ptrdiff_t diff = pt0 - pt1; size_t diff_sz = (size_t)diff; - size_t index = diff_sz / Main_sc_slab_region_size; - Constants_sc_union scrut = sizes[index]; + size_t index = diff_sz / Config_sc_slab_region_size; + Constants_sc_union size_as_union = sizes[index]; uint32_t size; - if (scrut.tag == Constants_Sc) - size = scrut.case_Sc; - else if (scrut.tag == Constants_Sc_ex) - size = scrut.case_Sc_ex; + if (size_as_union.tag == Constants_Sc) + size = size_as_union.case_Sc; + else if (size_as_union.tag == Constants_Sc_ex) + size = size_as_union.case_Sc_ex; else size = KRML_EABORT(uint32_t, "unreachable (pattern matches are exhaustive in F*)"); - size_t rem_slot = diff_sz % (size_t)4096U; - if (rem_slot % (size_t)size == 0U) + size_t rem_sc = diff_sz % Config_sc_slab_region_size; + if (Constants_uu___is_Sc(size_as_union)) + { + size_t rem_page = rem_sc % (size_t)4096U; + if (rem_page % (size_t)size == (size_t)0U) + return (size_t)(size - 2U); + else + return (size_t)0U; + } + else if (rem_sc % ((size_t)4096U * (size_t)64U) == (size_t)0U) return (size_t)(size - 2U); else - return 0U; + return (size_t)0U; } static bool slab_free(uint8_t *ptr) @@ -3879,18 +3985,39 @@ static bool slab_free(uint8_t *ptr) uint8_t *pt1 = Main_Meta_sc_all.slab_region; ptrdiff_t diff = pt0 - pt1; size_t diff_sz = (size_t)diff; - size_t index = diff_sz / Main_sc_slab_region_size; - Constants_sc_union scrut = sizes[index]; + size_t index = diff_sz / Config_sc_slab_region_size; + Constants_sc_union size_as_union = sizes[index]; uint32_t size; - if (scrut.tag == Constants_Sc) - size = scrut.case_Sc; - else if (scrut.tag == Constants_Sc_ex) - size = scrut.case_Sc_ex; + if (size_as_union.tag == Constants_Sc) + size = size_as_union.case_Sc; + else if (size_as_union.tag == Constants_Sc_ex) + size = size_as_union.case_Sc_ex; else size = KRML_EABORT(uint32_t, "unreachable (pattern matches are exhaustive in F*)"); - size_t rem_slab = diff_sz % Main_sc_slab_region_size; - size_t rem_slot = diff_sz % (size_t)4096U; - if (rem_slot % (size_t)size == 0U) + size_t rem_sc = diff_sz % Config_sc_slab_region_size; + if (Constants_uu___is_Sc(size_as_union)) + { + size_t rem_page = rem_sc % (size_t)4096U; + if (rem_page % (size_t)size == (size_t)0U) + { + uint8_t magic1 = ptr[(size_t)(size - 2U)]; + uint8_t magic2 = ptr[(size_t)(size - 1U)]; + if (magic1 == 42U && magic2 == 23U) + { + Steel_SpinLock_acquire(&Main_Meta_sc_all.size_classes[index].lock); + bool + r = SizeClass_deallocate_size_class(Main_Meta_sc_all.size_classes[index].data, ptr, rem_sc); + Steel_SpinLock_release(&Main_Meta_sc_all.size_classes[index].lock); + bool b = r; + return b; + } + else + return false; + } + else + return false; + } + else if (rem_sc % ((size_t)4096U * (size_t)64U) == (size_t)0U) { uint8_t magic1 = ptr[(size_t)(size - 2U)]; uint8_t magic2 = ptr[(size_t)(size - 1U)]; @@ -3898,7 +4025,7 @@ static bool slab_free(uint8_t *ptr) { Steel_SpinLock_acquire(&Main_Meta_sc_all.size_classes[index].lock); bool - r = SizeClass_deallocate_size_class(Main_Meta_sc_all.size_classes[index].data, ptr, rem_slab); + r = SizeClass_deallocate_size_class(Main_Meta_sc_all.size_classes[index].data, ptr, rem_sc); Steel_SpinLock_release(&Main_Meta_sc_all.size_classes[index].lock); bool b = r; return b; @@ -3935,7 +4062,7 @@ uint8_t *StarMalloc_malloc(size_t arena_id, size_t size) { size_t size_; if (size <= (size_t)4096U) - size_ = (size_t)4096U + 1U; + size_ = (size_t)4096U + (size_t)1U; else size_ = size; uint8_t *r = large_malloc(size_); @@ -3945,7 +4072,7 @@ uint8_t *StarMalloc_malloc(size_t arena_id, size_t size) uint8_t *StarMalloc_aligned_alloc(size_t arena_id, size_t alignment, size_t size) { - bool check = alignment > 0U && (size_t)131072U % alignment == 0U; + bool check = alignment > (size_t)0U && (size_t)131072U % alignment == (size_t)0U; if (check) { uint32_t alignment_as_u32 = (uint32_t)alignment; @@ -3970,7 +4097,7 @@ uint8_t *StarMalloc_aligned_alloc(size_t arena_id, size_t alignment, size_t size { size_t size_; if (size <= (size_t)4096U) - size_ = (size_t)4096U + 1U; + size_ = (size_t)4096U + (size_t)1U; else size_ = size; uint8_t *ptr = large_malloc(size_); @@ -4027,7 +4154,7 @@ uint8_t *StarMalloc_realloc(size_t arena_id, uint8_t *ptr, size_t new_size) uint8_t *new_ptr = StarMalloc_malloc(arena_id, new_size); return new_ptr; } - else if (new_size == 0U) + else if (new_size == (size_t)0U) { bool b = StarMalloc_free(ptr); if (b) @@ -4049,7 +4176,7 @@ uint8_t *StarMalloc_realloc(size_t arena_id, uint8_t *ptr, size_t new_size) { uint32_t r0 = SizeClassSelection_inv_impl(32768U, 7U, (uint32_t)old_size); size_t old_sc = (size_t)r0; - uint32_t r = SizeClassSelection_inv_impl(32768U, 7U, (uint32_t)(new_size + 2U)); + uint32_t r = SizeClassSelection_inv_impl(32768U, 7U, (uint32_t)(new_size + (size_t)2U)); size_t new_sc = (size_t)r; small_case_optim_condition = old_sc == new_sc; } @@ -4057,7 +4184,7 @@ uint8_t *StarMalloc_realloc(size_t arena_id, uint8_t *ptr, size_t new_size) small_case_optim_condition = false; bool large_case_optim_condition = !old_allocation_is_small && same_case && new_size <= old_size; - if (old_size == 0U) + if (old_size == (size_t)0U) { FatalError_die_from_realloc_invalid_previous_alloc(ptr); return NULL; diff --git a/dist/StarMalloc.h b/dist/StarMalloc.h index 0d70b862..64a9d07c 100644 --- a/dist/StarMalloc.h +++ b/dist/StarMalloc.h @@ -13,6 +13,7 @@ #include "Mman.h" #include "ExternUtils.h" #include "Constants.h" +#include "Config.h" #include "ArrayList.h" extern size_t StarMalloc_threshold; diff --git a/dist/internal/Slabs2.h b/dist/internal/Slabs2.h index 969c0f45..149c57c3 100644 --- a/dist/internal/Slabs2.h +++ b/dist/internal/Slabs2.h @@ -11,12 +11,6 @@ #include "ExternUtils.h" #include "ArrayList.h" -extern size_t SlabsCommon2_slab_region_size; - -extern size_t SlabsCommon2_slab_size; - -extern size_t SlabsCommon2_metadata_max_ex; - bool SlabsFree2_deallocate_slab( uint8_t *ptr, diff --git a/dist/internal/StarMalloc.h b/dist/internal/StarMalloc.h index bdc12f86..748940c1 100644 --- a/dist/internal/StarMalloc.h +++ b/dist/internal/StarMalloc.h @@ -6,7 +6,6 @@ #include "krmllib.h" -#include "internal/Slabs2.h" #include "../StarMalloc.h" typedef struct Impl_Trees_Cast_M_data_s @@ -30,10 +29,6 @@ typedef struct Impl_Trees_Cast_M_node_s } Impl_Trees_Cast_M_node; -extern size_t Main_metadata_max_ex; - -extern size_t Main_sc_slab_region_size; - extern size_t Main_slab_region_size; typedef struct Impl_Trees_Types_mmap_md_slabs_s diff --git a/dist/krmlinit.c b/dist/krmlinit.c index 1f83e4d6..9b1c4028 100644 --- a/dist/krmlinit.c +++ b/dist/krmlinit.c @@ -4,7 +4,6 @@ #include "krmlinit.h" #include "internal/StarMalloc.h" -#include "internal/Slabs2.h" #if defined(__GNUC__) && !(defined(_WIN32) || defined(_WIN64)) __attribute__ ((visibility ("hidden"))) @@ -12,13 +11,11 @@ __attribute__ ((visibility ("hidden"))) void krmlinit_globals(void) { - Main_metadata_max_ex = SlabsCommon2_metadata_max_ex; - Main_sc_slab_region_size = SlabsCommon2_slab_region_size; - Main_slab_region_size = Main_sc_slab_region_size * 32U * 4U; + Main_slab_region_size = Config_sc_slab_region_size * (size_t)32U * (size_t)4U; Impl_Trees_Types_init_mmap_md_slabs(&Impl_Trees_Types_metadata_slabs); init_mmap_md(&metadata); Main_Meta_sc_all = Main_Meta_init(); uint32_t page_size = 131072U; - StarMalloc_threshold = (size_t)page_size - 2U; + StarMalloc_threshold = (size_t)page_size - (size_t)2U; } diff --git a/dist/krmlinit.h b/dist/krmlinit.h index b9c3c64c..91fa3e86 100644 --- a/dist/krmlinit.h +++ b/dist/krmlinit.h @@ -7,6 +7,7 @@ #include "krmllib.h" #include "StarMalloc.h" +#include "Config.h" #if defined(__GNUC__) && !(defined(_WIN32) || defined(_WIN64)) __attribute__ ((visibility ("hidden")))