Revert "Avoid NULL check in free() and malloc_usable_size()."
This reverts commit 96d4120ac0
.
ivsalloc() depends on chunks_rtree being initialized. This can be
worked around via a NULL pointer check. However,
thread_allocated_tsd_get() also depends on initialization having
occurred, and there is no way to guard its call in free() that is
cheaper than checking whether ptr is NULL.
This commit is contained in:
19
test/null.c
19
test/null.c
@@ -1,19 +0,0 @@
|
||||
#include <stdio.h>
|
||||
#include <assert.h>
|
||||
|
||||
#define JEMALLOC_MANGLE
|
||||
#include "jemalloc_test.h"
|
||||
|
||||
int
|
||||
main(void)
|
||||
{
|
||||
|
||||
fprintf(stderr, "Test begin\n");
|
||||
|
||||
free(malloc(1));
|
||||
free(NULL);
|
||||
assert(malloc_usable_size(NULL) == 0);
|
||||
|
||||
fprintf(stderr, "Test end\n");
|
||||
return (0);
|
||||
}
|
@@ -1,2 +0,0 @@
|
||||
Test begin
|
||||
Test end
|
Reference in New Issue
Block a user