mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-07-24 13:53:11 +00:00
Thwart compiler optimizations.
This commit is contained in:
@@ -114,6 +114,10 @@ malloc_mus_free(void)
|
|||||||
void *p;
|
void *p;
|
||||||
|
|
||||||
p = malloc(1);
|
p = malloc(1);
|
||||||
|
if (p == NULL) {
|
||||||
|
test_fail("Unexpected malloc() failure");
|
||||||
|
return;
|
||||||
|
}
|
||||||
malloc_usable_size(p);
|
malloc_usable_size(p);
|
||||||
free(p);
|
free(p);
|
||||||
}
|
}
|
||||||
@@ -124,6 +128,10 @@ malloc_sallocx_free(void)
|
|||||||
void *p;
|
void *p;
|
||||||
|
|
||||||
p = malloc(1);
|
p = malloc(1);
|
||||||
|
if (p == NULL) {
|
||||||
|
test_fail("Unexpected malloc() failure");
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (sallocx(p, 0) < 1)
|
if (sallocx(p, 0) < 1)
|
||||||
test_fail("Unexpected sallocx() failure");
|
test_fail("Unexpected sallocx() failure");
|
||||||
free(p);
|
free(p);
|
||||||
@@ -143,6 +151,10 @@ malloc_nallocx_free(void)
|
|||||||
void *p;
|
void *p;
|
||||||
|
|
||||||
p = malloc(1);
|
p = malloc(1);
|
||||||
|
if (p == NULL) {
|
||||||
|
test_fail("Unexpected malloc() failure");
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (nallocx(1, 0) < 1)
|
if (nallocx(1, 0) < 1)
|
||||||
test_fail("Unexpected nallocx() failure");
|
test_fail("Unexpected nallocx() failure");
|
||||||
free(p);
|
free(p);
|
||||||
|
|||||||
Reference in New Issue
Block a user