diff options
author | Ton Roosendaal <ton@blender.org> | 2006-01-30 14:09:50 +0300 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2006-01-30 14:09:50 +0300 |
commit | e1936485952092b0ff96485666f86d65fe8f1e58 (patch) | |
tree | 415a94e0eed03d6db4f2f8933346c5ac9e52ff6b /source/blender/blenlib/BLI_threads.h | |
parent | 18ab7c468fbca1aeab57c6d9268535067be03ef3 (diff) |
Created threadsafe MEM_malloc versions in BLI_threads.h, now in use
for compositing code.
Officially malloc/calloc/free is threadsafe, but our secure malloc system
requires all memory blocks to be stored in a single list, so when two
threads write in this list you get conflicts.
Diffstat (limited to 'source/blender/blenlib/BLI_threads.h')
-rw-r--r-- | source/blender/blenlib/BLI_threads.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/source/blender/blenlib/BLI_threads.h b/source/blender/blenlib/BLI_threads.h index 5ab8c2a0b3f..a9927fa08ef 100644 --- a/source/blender/blenlib/BLI_threads.h +++ b/source/blender/blenlib/BLI_threads.h @@ -35,10 +35,14 @@ void BLI_init_threads (ListBase *threadbase, int (*do_thread)(void *), int tot); int BLI_available_threads(ListBase *threadbase); int BLI_available_thread_index(ListBase *threadbase); -void BLI_insert_thread (ListBase *threadbase, void *callerdata); +void BLI_insert_thread (ListBase *threadbase, void *callerdata); void BLI_remove_thread (ListBase *threadbase, void *callerdata); void BLI_end_threads (ListBase *threadbase); - + + /* threadsafe version of MEM_malloc and friends */ +void *MEM_mallocT(int len, char *name); +void *MEM_callocT(int len, char *name); +void MEM_freeT(void *poin); #endif |