electronstudio / jaylib-ffm

Other
7 stars 1 forks source link

make auto allocators optional #1

Open electronstudio opened 3 months ago

electronstudio commented 3 months ago

make sure advanced users have option to specify their own allocators to improve performance - the auto ones should not be mandatory anywhere

electronstudio commented 3 months ago

for constructors and raylib functions that allocate you can now specify your own arena allocator. the only auto arena is when converting string arguments to function calls. i guess this should be replaced by:

if function call is one that has string arguments:

performance impact of all this is probably so tiny it's not a priority

electronstudio commented 3 months ago

The auto arena for string arguments does actually reduce bunnymark by 4000 when using DrawText()!

Another alternative: allocate temp memory once on startup and then re-use it. not threadsafe. might need custom arena/allocator or something.

electronstudio commented 3 months ago

local arena for string arguments done