X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/4c04d8355923f8323a1a3195fe3b73ac08b984ea..011b6e172c0b7366132196dd9797f7bc3b951df2:/src/xbt/mmalloc/sbrk-sup.c diff --git a/src/xbt/mmalloc/sbrk-sup.c b/src/xbt/mmalloc/sbrk-sup.c index 52c8230bfb..40638c970c 100644 --- a/src/xbt/mmalloc/sbrk-sup.c +++ b/src/xbt/mmalloc/sbrk-sup.c @@ -8,44 +8,32 @@ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ -#include /* Prototypes for sbrk (maybe) */ +#include /* Prototypes for sbrk (maybe) */ -#include /* Prototypes for memcpy, memmove, memset, etc */ +#include /* Prototypes for memcpy, memmove, memset, etc */ #include "xbt.h" #include "mmprivate.h" -static void* sbrk_morecore (struct mdesc *mdp, int size); +static void *sbrk_morecore(struct mdesc *mdp, int size); #if NEED_DECLARATION_SBRK -extern void* sbrk (int size); +extern void *sbrk(int size); #endif -/* The mmalloc() package can use a single implicit malloc descriptor - for mmalloc/mrealloc/mfree operations which do not supply an explicit - descriptor. For these operations, sbrk() is used to obtain more core - from the system, or return core. This allows mmalloc() to provide - backwards compatibility with the non-mmap'd version. */ - -struct mdesc *__mmalloc_default_mdp; /* Use sbrk() to get more core. */ -static void* -sbrk_morecore (mdp, size) - struct mdesc *mdp; - int size; +static void *sbrk_morecore(mdp, size) +struct mdesc *mdp; +int size; { - void* result; - - if ((result = sbrk (size)) == (void*) -1) - { - result = NULL; - } - else - { - mdp -> breakval = (char*)mdp -> breakval + size; - mdp -> top = (char*)mdp -> top + size; - } + void *result; + + if ((result = sbrk(size)) == (void *) -1) { + result = NULL; + } else { + mdp->breakval = (char *) mdp->breakval + size; + mdp->top = (char *) mdp->top + size; + } return (result); } -