Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
kill little useless things in mmalloc. Still searching how to do the Big Cleanup...
authorMartin Quinson <martin.quinson@loria.fr>
Wed, 1 Feb 2012 14:40:07 +0000 (15:40 +0100)
committerMartin Quinson <martin.quinson@loria.fr>
Wed, 1 Feb 2012 14:43:53 +0000 (15:43 +0100)
src/xbt/mmalloc/mmap-sup.c
src/xbt/mmalloc/mmprivate.h

index 28f89bc..964e484 100644 (file)
 #include <fcntl.h>
 #include <sys/mman.h>
 
 #include <fcntl.h>
 #include <sys/mman.h>
 
-#ifndef SEEK_SET
-#define SEEK_SET 0
-#endif
-
 #include "mmprivate.h"
 #include "xbt/ex.h"
 
 #include "mmprivate.h"
 #include "xbt/ex.h"
 
    it out. */
 
 static size_t pagesize;
    it out. */
 
 static size_t pagesize;
-#if NEED_DECLARATION_GETPAGESIZE
-extern int getpagesize(void);
-#endif
 
 #define PAGE_ALIGN(addr) (void*) (((long)(addr) + pagesize - 1) & \
                                    ~(pagesize - 1))
 
 /* Return MAP_PRIVATE if MDP represents /dev/zero.  Otherwise, return
    MAP_SHARED.  */
 
 #define PAGE_ALIGN(addr) (void*) (((long)(addr) + pagesize - 1) & \
                                    ~(pagesize - 1))
 
 /* Return MAP_PRIVATE if MDP represents /dev/zero.  Otherwise, return
    MAP_SHARED.  */
-
 #define MAP_PRIVATE_OR_SHARED(MDP) (( MDP -> flags & MMALLOC_ANONYMOUS) \
                                     ? MAP_PRIVATE \
                                     : MAP_SHARED)
 
 /* Return MAP_ANONYMOUS if MDP uses anonymous mapping. Otherwise, return 0 */
 #define MAP_PRIVATE_OR_SHARED(MDP) (( MDP -> flags & MMALLOC_ANONYMOUS) \
                                     ? MAP_PRIVATE \
                                     : MAP_SHARED)
 
 /* Return MAP_ANONYMOUS if MDP uses anonymous mapping. Otherwise, return 0 */
-
 #define MAP_IS_ANONYMOUS(MDP) (((MDP) -> flags & MMALLOC_ANONYMOUS) \
                               ? MAP_ANONYMOUS \
                               : 0)
 #define MAP_IS_ANONYMOUS(MDP) (((MDP) -> flags & MMALLOC_ANONYMOUS) \
                               ? MAP_ANONYMOUS \
                               : 0)
index d3f8442..f351b59 100644 (file)
 #  endif
 #endif
 
 #  endif
 #endif
 
-#ifndef MIN
-#  define MIN(A, B) ((A) < (B) ? (A) : (B))
-#endif
-
 #define MMALLOC_MAGIC          "mmalloc"       /* Mapped file magic number */
 #define MMALLOC_MAGIC_SIZE     8       /* Size of magic number buf */
 #define MMALLOC_VERSION                1       /* Current mmalloc version */
 #define MMALLOC_MAGIC          "mmalloc"       /* Mapped file magic number */
 #define MMALLOC_MAGIC_SIZE     8       /* Size of magic number buf */
 #define MMALLOC_VERSION                1       /* Current mmalloc version */
@@ -248,7 +244,6 @@ void mmalloc_display_info(void *h);
 #define MMALLOC_DEVZERO                (1 << 0)        /* Have mapped to /dev/zero */
 #define MMALLOC_ANONYMOUS (1 << 1)      /* Use anonymous mapping */
 #define MMALLOC_INITIALIZED    (1 << 2)        /* Initialized mmalloc */
 #define MMALLOC_DEVZERO                (1 << 0)        /* Have mapped to /dev/zero */
 #define MMALLOC_ANONYMOUS (1 << 1)      /* Use anonymous mapping */
 #define MMALLOC_INITIALIZED    (1 << 2)        /* Initialized mmalloc */
-#define MMALLOC_MMCHECK_USED   (1 << 3)        /* mmcheckf() called already */
 
 /* Internal version of `mfree' used in `morecore'. */
 
 
 /* Internal version of `mfree' used in `morecore'. */