2018-10-09 23:41:36 +08:00
|
|
|
#include "test/jemalloc_test.h"
|
|
|
|
|
|
|
|
TEST_BEGIN(test_zero_alloc) {
|
|
|
|
void *res = malloc(0);
|
|
|
|
assert(res);
|
2021-02-18 04:40:11 +08:00
|
|
|
size_t usable = TEST_MALLOC_SIZE(res);
|
2018-10-09 23:41:36 +08:00
|
|
|
assert(usable > 0);
|
|
|
|
free(res);
|
|
|
|
}
|
|
|
|
TEST_END
|
|
|
|
|
|
|
|
int
|
|
|
|
main(void) {
|
|
|
|
return test(
|
|
|
|
test_zero_alloc);
|
|
|
|
}
|