-
Notifications
You must be signed in to change notification settings - Fork 143
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
Supplying custom allocation/deallocation routines #372
Comments
Sorry for long delay with the answer, I overlooked your message. I think custom allocation would be useful for some applications. So it is worth to pursue this. I only have one important requirement is to save somehow the old library interface for compatibility. |
Thanks for your feedback :-) |
I am usually working in an environment where custom allocators are used for various reasons and usage of plain
malloc
/free
is frowned upon. Thankfully many libraries allow their users to supply custom (de)allocation routines.While support for this can be as simple as some defines that default to
malloc
/free
, I always found that in practice it is way more convenient to be able to pass some user data (often just avoid*
) to the (de)allocation routines (similar to what is suggested in #356). See for example PCRE2 that does this upon context creation (e.g.pcre2_general_context_create
).If you feel that this would fit MIR and is worth pursuing, I could try to put together a pull request for this :-)
The text was updated successfully, but these errors were encountered: