Darwin malloc_size override support proposal.
Darwin has similar api than Linux/FreeBSD's malloc_usable_size.
This commit is contained in:
@@ -30,7 +30,7 @@ do_allocs(size_t size, bool zero, size_t lg_align) {
|
||||
if (opt_junk_alloc && !zero) { \
|
||||
expect_ptr_eq(ptr, last_junked_ptr, ""); \
|
||||
expect_zu_eq(last_junked_usize, \
|
||||
malloc_usable_size(ptr), ""); \
|
||||
TEST_MALLOC_SIZE(ptr), ""); \
|
||||
} \
|
||||
} while (0)
|
||||
if (!zero && lg_align == 0) {
|
||||
|
@@ -43,7 +43,7 @@ test_combinations(szind_t ind, size_t sizes_array[N_PTRS],
|
||||
int flags = flags_array[i];
|
||||
void *p = mallocx(sz, flags);
|
||||
assert_ptr_not_null(p, "malloc() failed");
|
||||
assert(malloc_usable_size(p) == sz_index2size(ind));
|
||||
assert(TEST_MALLOC_SIZE(p) == sz_index2size(ind));
|
||||
ptrs[i] = p;
|
||||
live_req_sum += sz;
|
||||
live_count++;
|
||||
|
Reference in New Issue
Block a user