I appreciate the ability to provide ngf_allocation_callbacks, but one problem is that the callbacks don't take a void* userdata parameter, requiring any custom allocators to rely on global state. I'm happy to do the changes and submit a PR but wanted to see if there's interest first. It seems like a fairly small change, since all allocations seem to go through macros NGFI_ALLOC/NGFI_FREE, so the change would be:
Adding a void* userdata field to ngf_allocation_callbacks
Changing the signatures of allocate and free in ngf_allocation_callbacks to take a void* as a final argument.
Changing the NGFI_ALLOC/FREE macros to pass in the userdata pointer.
I appreciate the ability to provide
ngf_allocation_callbacks
, but one problem is that the callbacks don't take avoid* userdata
parameter, requiring any custom allocators to rely on global state. I'm happy to do the changes and submit a PR but wanted to see if there's interest first. It seems like a fairly small change, since all allocations seem to go through macrosNGFI_ALLOC/NGFI_FREE
, so the change would be:void* userdata
field tongf_allocation_callbacks
allocate
andfree
inngf_allocation_callbacks
to take avoid*
as a final argument.NGFI_ALLOC/FREE
macros to pass in the userdata pointer.