]> pd.if.org Git - pdclib/blobdiff - opt/dlmalloc/dlmalloc.c
Redeclaration of standard functions by dlmalloc. Fixed. Re-enabled warnings in Jamrules.
[pdclib] / opt / dlmalloc / dlmalloc.c
index 183f08a59a14559d643b8514587737d0c58931d7..865b5b95afa46c04084dc241ceff38589d160b17 100644 (file)
@@ -835,6 +835,8 @@ extern "C" {
 #define dlbulk_free            bulk_free\r
 #endif /* USE_DL_PREFIX */\r
 \r
+#if 0 // Redeclaration warnings as PDCLib already declares these in <stdio.h>\r
+\r
 /*\r
   malloc(size_t n)\r
   Returns a pointer to a newly allocated chunk of at least n bytes, or\r
@@ -891,6 +893,8 @@ DLMALLOC_EXPORT void* dlcalloc(size_t, size_t);
 */\r
 DLMALLOC_EXPORT void* dlrealloc(void*, size_t);\r
 \r
+#endif\r
+\r
 /*\r
   realloc_in_place(void* p, size_t n)\r
   Resizes the space allocated for p to size n, only if this can be\r
@@ -1644,7 +1648,6 @@ unsigned char _BitScanReverse(unsigned long *index, unsigned long mask);
    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
@@ -3837,7 +3840,7 @@ static void* mmap_alloc(mstate m, size_t nb) {
 /* 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
@@ -6263,4 +6266,4 @@ int main( void )
     return TEST_RESULTS;\r
 }\r
 \r
-#endif
\ No newline at end of file
+#endif\r