Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/intern
diff options
context:
space:
mode:
authorErwin Coumans <blender@erwincoumans.com>2006-02-17 23:18:49 +0300
committerErwin Coumans <blender@erwincoumans.com>2006-02-17 23:18:49 +0300
commit78942aa8439ec6d304e9f85421a918f44100496c (patch)
tree6c8c75e9f667fd9a20fdda96293a9f5007485917 /intern
parent69d00bccaa87c3bec869f5beed987ca750825818 (diff)
temporarily fix from Johnny Matthews committed, win32 doesn't have munmap. Someone can worry about a future mmap-like implementation.
Diffstat (limited to 'intern')
-rw-r--r--intern/guardedalloc/intern/mallocn.c37
1 files changed, 22 insertions, 15 deletions
diff --git a/intern/guardedalloc/intern/mallocn.c b/intern/guardedalloc/intern/mallocn.c
index 763cb655c8d..e682f17a386 100644
--- a/intern/guardedalloc/intern/mallocn.c
+++ b/intern/guardedalloc/intern/mallocn.c
@@ -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)