From: Martin Quinson Date: Thu, 2 Feb 2012 13:53:54 +0000 (+0100) Subject: kill an unused/undocumented/un-understood function X-Git-Tag: exp_20120216~89 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/c3d49b133b582d863f53002530ed7c65ad6dbcae?hp=506c9d37d4f03855c37f075b5c88c6efe6958ccb kill an unused/undocumented/un-understood function --- diff --git a/include/xbt/mmalloc.h b/include/xbt/mmalloc.h index 74643cd3ee..f6ca9056e8 100644 --- a/include/xbt/mmalloc.h +++ b/include/xbt/mmalloc.h @@ -55,8 +55,6 @@ extern void *mmalloc_detach(xbt_mheap_t md); /* return the heap used when NULL is passed as first argument to any mm* function */ extern xbt_mheap_t mmalloc_get_default_md(void); -extern void *mmalloc_findbase(int size); - extern void mmalloc_display_info_heap(xbt_mheap_t h); /* To change the heap used when using the legacy version malloc/free/realloc and such */ diff --git a/src/xbt/mmalloc/mmorecore.c b/src/xbt/mmalloc/mmorecore.c index 2c68d503e4..76ff04b876 100644 --- a/src/xbt/mmalloc/mmorecore.c +++ b/src/xbt/mmalloc/mmorecore.c @@ -144,41 +144,3 @@ void *__mmalloc_remap_core(struct mdesc *mdp) return ((void *) base); } -void *mmalloc_findbase(int size) -{ - int fd; - int flags; - void *base = NULL; - -#ifdef MAP_ANONYMOUS - flags = MAP_PRIVATE | MAP_ANONYMOUS; - fd = -1; -#else -#ifdef MAP_FILE - flags = MAP_PRIVATE | MAP_FILE; -#else - flags = MAP_PRIVATE; -#endif - fd = open("/dev/zero", O_RDWR); - if (fd != -1) { - return ((void *) NULL); - } -#endif - base = mmap(0, size, PROT_READ | PROT_WRITE, flags, fd, 0); - if (base != (void *) -1) { - munmap(base, (size_t) size); - } - if (fd != -1) { - close(fd); - } - if (base == 0) { - /* Don't allow mapping at address zero. We use that value - to signal an error return, and besides, it is useful to - catch NULL pointers if it is unmapped. Instead start - at the next page boundary. */ - base = (void *) (long) getpagesize(); - } else if (base == (void *) -1) { - base = NULL; - } - return ((void *) base); -}