[Bf-committers] changing threadsafe malloc

blendix at pandora.be brechtvanlommel at pandora.be
Wed Sep 6 11:00:55 CEST 2006

Hey all,

I'm implementing a compositor node for scaling, and would like to use the imbuf scaling functions. These can't be called directly, because they do malloc with the MEM_*N functions, and with threads enabled MEM_*T should be used instead. Other nodes do some ugly hacks around this problem.

Maybe a nicer solution would be to make the MEM_*N functions threadsafe when threads are enabled. The BLI_init_threads could set two callback functions to be use by MEM_*N for lock/unlock, and BLI_end_threads would NULL them again. This would also allow to remove those MEM_*T functions, it's easy to forget using them.

Good idea? If so, can I commit this change?


More information about the Bf-committers mailing list