X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=opt%2Fdlmalloc%2Fdlmalloc.c;h=18cf0d6511db5bd30a15ec6cb1440d5c2bf84b92;hb=29387e76cd5cd340fe7d811dc9830931d3d0ec9b;hp=32c3c35686d582443a7a2f3033936c7e87506207;hpb=7015f5842d05bd5da32523048e4260e60e9e310c;p=pdclib diff --git a/opt/dlmalloc/dlmalloc.c b/opt/dlmalloc/dlmalloc.c index 32c3c35..18cf0d6 100644 --- a/opt/dlmalloc/dlmalloc.c +++ b/opt/dlmalloc/dlmalloc.c @@ -516,6 +516,7 @@ MAX_RELEASE_CHECK_RATE default: 4095 unless not HAVE_MMAP improvement at the expense of carrying around more memory. */ +#ifndef REGTEST #include "dlmalloc.h" /* Version identifier to allow people to support multiple versions */ @@ -1643,7 +1644,6 @@ unsigned char _BitScanReverse(unsigned long *index, unsigned long mask); is unlikely to be needed, but is supplied just in case. */ #define MMAP_FLAGS (MAP_PRIVATE) -static int dev_zero_fd = -1; /* Cached file descriptor for /dev/zero. */ #define MMAP_DEFAULT(s) ((dev_zero_fd < 0) ? \ (dev_zero_fd = open("/dev/zero", O_RDWR), \ mmap(0, (s), MMAP_PROT, MMAP_FLAGS, dev_zero_fd, 0)) : \ @@ -3836,7 +3836,7 @@ static void* mmap_alloc(mstate m, size_t nb) { /* Realloc using mmap */ static mchunkptr mmap_resize(mstate m, mchunkptr oldp, size_t nb, int flags) { size_t oldsize = chunksize(oldp); - flags = flags; /* placate people compiling -Wunused */ + (void) flags; if (is_small(nb)) /* Can't shrink mmap regions below small size */ return 0; /* Keep old chunk if big enough but not too big */ @@ -6251,3 +6251,15 @@ History: structure of old version, but most details differ.) */ +#endif + +#ifdef TEST +#include <_PDCLIB_test.h> + +/* TODO: TEST ME */ +int main( void ) +{ + return TEST_RESULTS; +} + +#endif