Loading...
--- libmalloc/libmalloc-792.80.2/tests/xzone_bitmap.c
+++ libmalloc/libmalloc-521.120.7/tests/xzone_bitmap.c
@@ -2,8 +2,6 @@
#include <inttypes.h>
#include <../src/internal.h>
-
-T_GLOBAL_META(T_META_RUN_CONCURRENTLY(true), T_META_TAG_VM_PREFERRED);
#if CONFIG_XZONE_MALLOC
@@ -264,8 +262,9 @@
chunk->xzc_free = _xzm_xzone_free_mask(NULL, chunk_capacity);
chunk->xzc_used = 0;
chunk->xzc_bits.xzcb_kind = XZM_SLICE_KIND_SMALL_CHUNK;
+ chunk->xzc_bits.xzcb_has_aligned = false;
chunk->xzc_bits.xzcb_is_pristine = true;
- chunk->xzc_bits.xzcb_on_partial_list = false;
+ chunk->xzc_bits.xzcb_enqueued = false;
chunk->xzcs_slice_count = slice_count;
for (xzm_slice_count_t idx = 1; idx < chunk->xzcs_slice_count; ++idx) {
@@ -286,10 +285,10 @@
xzm_chunk_t chunk = &chunks[chunk_idx];
/*
- * slice: |<-16KiB->|<-16KiB->|<-16KiB->|<-16KiB->|
- * block: |<-14KiB>|<-14KiB>|<-14KiB>|<-14KiB>|
- * free: | 0 | 1 | 1 | 0 |
- * vm op: | 0 | 1 | 1 | 0 |
+ * slice: |<-16KiB->|<-16KiB->|<-16KiB->|<-16KiB->|<-16KiB->|<-16KiB->|<-16KiB->|<-16KiB->|
+ * block: |<-14KiB>|<-14KiB>|<-14KiB>|<-14KiB>|<14KiB->|<14KiB->|<14KiB->|<14KiB->|<14KiB->|
+ * free: | 1 | 0 | 1 | 0 | 1 | 1 | 0 | 1 | 0 |
+ * vm op: | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 |
*/
puts("Checking block size smaller than slice size...");
{
@@ -298,8 +297,9 @@
"Block smaller than slice size");
const uint32_t chunk_capacity = XZM_SMALL_CHUNK_SIZE / block_size;
chunk_init(chunks, slice_count, chunk_capacity);
- chunk->xzc_free = _xzm_xzone_free_mask(NULL, chunk_capacity) & 0b0110;
- const expected_t expected[] = {{0, 0}, {1, 1}, {1, 1}, {0, 0}};
+ chunk->xzc_free = _xzm_xzone_free_mask(NULL, chunk_capacity) & 0b010110101;
+ const expected_t expected[] = {{0, 0}, {0, 0}, {0, 0}, {0, 0},
+ {4, 1}, {4, 1}, {0, 0}, {0, 0}, {0, 0}};
_Static_assert(countof(expected) == chunk_capacity,
"Correct number of expected results");
for (xzm_block_index_t idx = 0; idx < chunk_capacity; ++idx) {
@@ -325,10 +325,10 @@
}
/*
- * slice: |<16KiB>|<16KiB>|<16KiB>|<16KiB>|
- * block: |<16KiB>|<16KiB>|<16KiB>|<16KiB>|
- * free: | 1 | 0 | 1 | 0 |
- * vm op: | 1 | 0 | 1 | 0 |
+ * slice: |<16KiB>|<16KiB>|<16KiB>|<16KiB>|<16KiB>|<16KiB>|<16KiB>|<16KiB>|
+ * block: |<16KiB>|<16KiB>|<16KiB>|<16KiB>|<16KiB>|<16KiB>|<16KiB>|<16KiB>|
+ * free: | 1 | 0 | 1 | 0 | 1 | 0 | 1 | 0 |
+ * vm op: | 1 | 0 | 1 | 0 | 1 | 0 | 1 | 0 |
*/
puts("Checking block size equal to slice size...");
{
@@ -337,8 +337,9 @@
"Block equal to slice size");
const uint32_t chunk_capacity = XZM_SMALL_CHUNK_SIZE / block_size;
chunk_init(chunks, slice_count, chunk_capacity);
- chunk->xzc_free = _xzm_xzone_free_mask(NULL, chunk_capacity) & 0b0101;
- const expected_t expected[] = {{0, 1}, {0, 0}, {2, 1}, {0, 0}};
+ chunk->xzc_free = _xzm_xzone_free_mask(NULL, chunk_capacity) & 0b01010101;
+ const expected_t expected[] = {{0, 1}, {0, 0}, {2, 1}, {0, 0},
+ {4, 1}, {0, 0}, {6, 1}, {0, 0}};
_Static_assert(countof(expected) == chunk_capacity,
"Correct number of expected results");
for (xzm_block_index_t idx = 0; idx < chunk_capacity; ++idx) {
@@ -364,10 +365,10 @@
}
/*
- * slice: |<16KiB>|<16KiB>|<16KiB>|<16KiB>|
- * block: |<-20KiB->|<-20KiB->|<-20KiB->|
- * free: | 1 | 0 | 1 |
- * vm op: | 1 | 0 | 1 |
+ * slice: |<16KiB>|<16KiB>|<16KiB>|<16KiB>|<16KiB>|<16KiB>|<16KiB>|
+ * block: |<-20KiB->|<-20KiB->|<-20KiB->|<-20KiB->|<-20KiB->|<-20KiB->|
+ * free: | 1 | 0 | 1 | 0 | 1 | 0 |
+ * vm op: | 1 | 0 | 0 | 0 | 1 | 0 |
*/
puts("Checking block size greater than slice size...");
{
@@ -376,8 +377,9 @@
"Block greater than slice size");
const uint32_t chunk_capacity = XZM_SMALL_CHUNK_SIZE / block_size;
chunk_init(chunks, slice_count, chunk_capacity);
- chunk->xzc_free = _xzm_xzone_free_mask(NULL, chunk_capacity) & 0b101;
- const expected_t expected[] = {{0, 1}, {0, 0}, {3, 1}};
+ chunk->xzc_free = _xzm_xzone_free_mask(NULL, chunk_capacity) & 0b010101;
+ const expected_t expected[] = {{0, 1}, {0, 0}, {0, 0}, {0, 0},
+ {5, 1}, {0, 0}};
_Static_assert(countof(expected) == chunk_capacity,
"Correct number of expected results");
for (xzm_block_index_t idx = 0; idx < chunk_capacity; ++idx) {
@@ -440,6 +442,8 @@
run_programmatic_tests(chunk, slice_count, chunk_idx, populate);
}
+T_GLOBAL_META(T_META_RUN_CONCURRENTLY(true));
+
T_DECL(slice_on_allocate, "Slice range computation on allocation from small chunk",
T_META_TAG_XZONE_ONLY)
{
@@ -455,13 +459,13 @@
#else // CONFIG_XZONE_MALLOC
T_DECL(slice_on_allocate, "Slice range computation on allocation from small chunk",
- T_META_ENABLED(false), T_META_TAG_NO_ALLOCATOR_OVERRIDE)
+ T_META_ENABLED(false))
{
T_SKIP("Nothing to test for !CONFIG_XZONE_MALLOC");
}
T_DECL(slice_on_deallocate, "Slice range computation on deallocation from small chunk",
- T_META_ENABLED(false), T_META_TAG_NO_ALLOCATOR_OVERRIDE)
+ T_META_ENABLED(false))
{
T_SKIP("Nothing to test for !CONFIG_XZONE_MALLOC");
}