-
Notifications
You must be signed in to change notification settings - Fork 326
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Automatically free data when removing it from a container #45
Comments
Is the callback required? I mean, the conf structure already contains a pointer to 'free' function ('mem_free'). I think a boolean flag could be enough, i.e. |
Well And when you think about it, the container shouldn't really need care about how the data is created or destroyed because it's really only there to organize it. So letting the user specify an optional callback when the data is being removed is I think the best way to go about this. The callback could also be any type of function not just a |
Ah, I understand what you're saying. Yes, you are right, specifying the callback function is proper way to go. |
I'm also have the same issue, Like hashtable_remove(table, key, out). |
There should be a more convenient way to free data after it's removed from a container and
it should be:
I suggest adding a callback to
remove
type functions so that instead of:we could write something like this:
The text was updated successfully, but these errors were encountered: