Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
cosmetics and comment improvements
[simgrid.git] / src / xbt / mmalloc / attach.c
index 5c6b3d2..531a436 100644 (file)
@@ -49,7 +49,7 @@ static struct mdesc *reuse(int fd);
 
    If the open file corresponding to FD is from a previous use of
    mmalloc and passes some basic sanity checks to ensure that it is
-   compatible with the current mmalloc package, then it's data is
+   compatible with the current mmalloc package, then its data is
    mapped in and is immediately accessible at the same addresses in
    the current process as the process that created the file (ignoring
    the BASEADDR parameter).
@@ -63,9 +63,8 @@ static struct mdesc *reuse(int fd);
 
    On success, returns a "malloc descriptor" which is used in subsequent
    calls to other mmalloc package functions.  It is explicitly "void *"
-   ("char *" for systems that don't fully support void) so that users
-   of the package don't have to worry about the actual implementation
-   details.
+   so that users of the package don't have to worry about the actual
+   implementation details.
 
    On failure returns NULL. */
 
@@ -105,7 +104,6 @@ void *mmalloc_attach(int fd, void *baseaddr)
   strncpy(mdp->magic, MMALLOC_MAGIC, MMALLOC_MAGIC_SIZE);
   mdp->headersize = sizeof(mtemp);
   mdp->version = MMALLOC_VERSION;
-  mdp->morecore = __mmalloc_mmap_morecore;
   mdp->fd = fd;
   mdp->base = mdp->breakval = mdp->top = baseaddr;
   mdp->next_mdesc = NULL;
@@ -129,7 +127,7 @@ void *mmalloc_attach(int fd, void *baseaddr)
      fails, then close the file descriptor if it was opened by us, and arrange
      to return a NULL. */
 
-  if ((mbase = mdp->morecore(mdp, sizeof(mtemp))) != NULL) {
+  if ((mbase = mmorecore(mdp, sizeof(mtemp))) != NULL) {
     memcpy(mbase, mdp, sizeof(mtemp));
   } else {
     THROWF(system_error,0,"morecore failed to get some memory!");
@@ -192,7 +190,6 @@ static struct mdesc *reuse(int fd)
   if (__mmalloc_remap_core(&mtemp) == mtemp.base) {
     mdp = (struct mdesc *) mtemp.base;
     mdp->fd = fd;
-    mdp->morecore = __mmalloc_mmap_morecore;
     if(!mdp->refcount){
       sem_init(&mdp->sem, 1, 1);
       mdp->refcount++;