X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/blobdiff_plain/41e5d54678673b39f2d6ae43a291fb79c5c3f45b..b435182d5838da4fb7425466263df898641247dc:/lib/libc/stdlib/nmalloc.c diff --git a/lib/libc/stdlib/nmalloc.c b/lib/libc/stdlib/nmalloc.c index faa1e5cc60..739d738e7a 100644 --- a/lib/libc/stdlib/nmalloc.c +++ b/lib/libc/stdlib/nmalloc.c @@ -183,7 +183,7 @@ typedef struct slglobaldata { */ #define WEIRD_ADDR 0xdeadc0de #define MAX_COPY sizeof(weirdary) -#define ZERO_LENGTH_PTR ((void *)-8) +#define ZERO_LENGTH_PTR ((void *)&malloc_dummy_pointer) #define BIGHSHIFT 10 /* bigalloc hash table */ #define BIGHSIZE (1 << BIGHSHIFT) @@ -219,6 +219,7 @@ static struct slglobaldata SLGlobalData[SLGD_MAX]; static bigalloc_t bigalloc_array[BIGHSIZE]; static spinlock_t bigspin_array[BIGXSIZE]; static int malloc_panic; +static int malloc_dummy_pointer; static const int32_t weirdary[16] = { WEIRD_ADDR, WEIRD_ADDR, WEIRD_ADDR, WEIRD_ADDR, @@ -1134,7 +1135,7 @@ _vmem_alloc(size_t size, size_t align, int flags) * Free a chunk of memory allocated with _vmem_alloc() */ static void -_vmem_free(void *ptr, vm_size_t size) +_vmem_free(void *ptr, size_t size) { munmap(ptr, size); }