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
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2006-09-06 23:13:23 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2006-09-06 23:13:23 +0400
commite7d6537f1c5227005ccddc52987ea720ba66bc80 (patch)
tree5ac48fd44121194b879fc002d369281494a7598d /source/blender/blenpluginapi
parentd444f25b2864b7d4a9ae39211c695e36ffd813a8 (diff)
Added support for threadsafe MEM_mallocN/MEM_freeN in the guardedalloc
module itself, replacing the special MEM_mallocT/MEM_freeT functions. Mutex locking is only enabled when threads are running. There was no good reason to have these separate, it just led to ugly hacks when calling functions with non-threadsafe malloc from threads.
Diffstat (limited to 'source/blender/blenpluginapi')
-rw-r--r--source/blender/blenpluginapi/intern/pluginapi.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/source/blender/blenpluginapi/intern/pluginapi.c b/source/blender/blenpluginapi/intern/pluginapi.c
index 872c8c55141..43c4727cea1 100644
--- a/source/blender/blenpluginapi/intern/pluginapi.c
+++ b/source/blender/blenpluginapi/intern/pluginapi.c
@@ -76,20 +76,21 @@ LIBEXPORT short freeN(void *vmemh)
return MEM_freeN(vmemh);
}
-
+/* these are not needed anymore, mallocN/callocN/freeN is now threadsafe */
LIBEXPORT void *mallocT(int len, char *str)
{
- return MEM_mallocT(len, str);
+ return MEM_mallocN(len, str);
}
LIBEXPORT void *callocT(int len, char *str)
{
- return MEM_callocT(len, str);
+ return MEM_callocN(len, str);
}
LIBEXPORT void freeT(void *vmemh)
{
- return MEM_freeT(vmemh);
+ MEM_freeN(vmemh);
+ return;
}