improvement at the expense of carrying around more memory.\r
*/\r
\r
+#ifndef REGTEST\r
#include "dlmalloc.h"\r
\r
/* Version identifier to allow people to support multiple versions */\r
is unlikely to be needed, but is supplied just in case.\r
*/\r
#define MMAP_FLAGS (MAP_PRIVATE)\r
-static int dev_zero_fd = -1; /* Cached file descriptor for /dev/zero. */\r
#define MMAP_DEFAULT(s) ((dev_zero_fd < 0) ? \\r
(dev_zero_fd = open("/dev/zero", O_RDWR), \\r
mmap(0, (s), MMAP_PROT, MMAP_FLAGS, dev_zero_fd, 0)) : \\r
/* Realloc using mmap */\r
static mchunkptr mmap_resize(mstate m, mchunkptr oldp, size_t nb, int flags) {\r
size_t oldsize = chunksize(oldp);\r
- flags = flags; /* placate people compiling -Wunused */\r
+ (void) flags;\r
if (is_small(nb)) /* Can't shrink mmap regions below small size */\r
return 0;\r
/* Keep old chunk if big enough but not too big */\r
structure of old version, but most details differ.)\r
\r
*/\r
+#endif\r
+\r
+#ifdef TEST\r
+#include <_PDCLIB_test.h>\r
+\r
+/* TODO: TEST ME */\r
+int main( void )\r
+{\r
+ return TEST_RESULTS;\r
+}\r
+\r
+#endif\r