temporarily fix from Johnny Matthews committed, win32 doesn't have munmap. Someone...
authorErwin Coumans <blender@erwincoumans.com>
Fri, 17 Feb 2006 20:18:49 +0000 (20:18 +0000)
committerErwin Coumans <blender@erwincoumans.com>
Fri, 17 Feb 2006 20:18:49 +0000 (20:18 +0000)
intern/guardedalloc/intern/mallocn.c

index 763cb655c8d9ea5454d094184ab86f1670f36c7d..e682f17a386391af2c1a963f8f02e8a8022fcbd2 100644 (file)
@@ -386,21 +386,28 @@ static void remlink(localListBase *listbase, void *vlink)
 
 static void rem_memblock(MemHead *memh)
 {
-       remlink(membase,&memh->next);
-       if (memh->prev){
-               if (memh->next) MEMNEXT(memh->prev)->nextname = MEMNEXT(memh->next)->name;
-               else MEMNEXT(memh->prev)->nextname = 0;
-       }
-
-       totblock--;
-       mem_in_use -= memh->len;
-       if(memh->mmap) {
-               mmap_in_use -= memh->len;
-               if (munmap(memh, memh->len + sizeof(MemHead) + sizeof(MemTail)))
-                       printf("Couldn't unmap memory %s\n", memh->name);
-       }
-       else    
-               free(memh);
+    remlink(membase,&memh->next);
+    if (memh->prev){
+        if (memh->next) MEMNEXT(memh->prev)->nextname = 
+MEMNEXT(memh->next)->name;
+        else MEMNEXT(memh->prev)->nextname = 0;
+    }
+
+    totblock--;
+    mem_in_use -= memh->len;
+   
+#if defined(AMIGA) || defined(__BeOS) || defined(WIN32)
+    free(memh);
+#else   
+   
+    if(memh->mmap) {
+        mmap_in_use -= memh->len;
+        if (munmap(memh, memh->len + sizeof(MemHead) + sizeof(MemTail)))
+            printf("Couldn't unmap memory %s\n", memh->name);
+    }
+    else   
+        free(memh);
+#endif
 }
 
 static void MemorY_ErroR(const char *block, const char *error)