#fn ptr with state
1 messages · Page 1 of 1 (latest)
the new returned function needs the allocator? if so use a struct
bundle your fn pointer with a struct with the state it needs, then pass the state as a parameter(s) to the fn when calling it.
the new function allocates but it's a function ptr being called by C code
the c code should provide a way to pass your own data, usually via a type erased pointer.
if ti doesnt its a bad c lib, you'd have to use a global to get around it.
i think it does, ill try looking into that and return