by mappu · 13y ago · 0 comments
If I understand correctly, though, your implementation leaks memory. In my case I use a GC to free the thunks when they are no longer accessible.
Adding a GC is a separate task and several exist for C. Though if you were using C++, you could put together some RAII sugar or smart pointers around it all, but in that case you have std::bind1st and functors available anyway (although this is still the only way to meet the raw-pointer use case).