char *tmpdir = getenv("TEMP");
mmap_data_t *data;
int fd;
- size += sizeof(mmap-data_t); // waste block
+ size += sizeof(mmap_data_t); // waste block
dpsnprintf(vabuf, sizeof(vabuf), "%s/darkplaces.XXXXXX", tmpdir ? tmpdir : "/tmp");
fd = mkstemp(vabuf);
if(fd < 0)
return NULL;
}
if (pool == NULL)
- Sys_Error("Mem_Alloc: pool == NULL (alloc at %s:%i)", filename, fileline);
+ {
+ if(olddata)
+ pool = ((memheader_t *)((unsigned char *) olddata - sizeof(memheader_t)))->pool;
+ else
+ Sys_Error("Mem_Alloc: pool == NULL (alloc at %s:%i)", filename, fileline);
+ }
if (mem_mutex)
Thread_LockMutex(mem_mutex);
if (developer_memory.integer)