Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
We don't intend to support pre-ansi platforms, so cleanup mmalloc code
[simgrid.git] / src / xbt / mmalloc / detach.c
index 1780679..4c6e459 100644 (file)
@@ -20,6 +20,7 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 Boston, MA 02111-1307, USA.  */
 
+#include <unistd.h>   /* close */
 #include <sys/types.h>
 #include "mmprivate.h"
 
@@ -37,9 +38,8 @@ Boston, MA 02111-1307, USA.  */
    region we are about to unmap, so we first make a local copy of it on the
    stack and use the copy. */
 
-PTR
-mmalloc_detach (md)
-     PTR md;
+void*
+mmalloc_detach (void *md)
 {
   struct mdesc mtemp;
 
@@ -51,7 +51,7 @@ mmalloc_detach (md)
       /* Now unmap all the pages associated with this region by asking for a
         negative increment equal to the current size of the region. */
       
-      if ((mtemp.morecore (&mtemp, mtemp.base - mtemp.breakval)) == NULL)
+      if ((mtemp.morecore (&mtemp, (char*)mtemp.base - (char*)mtemp.breakval)) == NULL)
        {
          /* Deallocating failed.  Update the original malloc descriptor
             with any changes */