vec icon indicating copy to clipboard operation
vec copied to clipboard

Custom Memory Allocator Support

Open ForeverZer0 opened this issue 4 years ago • 2 comments

I am unsure if this project is still actively maintained, though I thought I would create the issue as it is still used in code today.

I wanted to propose the addition of support for custom memory allocation and freeing, just a simple set of macros (i.e. VEC_MALLOC, VEC_FREE, etc.). When such macros are defined, the library will use them in place of the default ones.

It is obviously trivial for users to add this behavior themselves with a few quick find/replace in the editor, I just thought it would be a nice feature to have out of the box that could be easily added without too much effort.

If you are willing to accept pull-requests, I would be happy to issue one for it. Either way, thank you for sharing :)

ForeverZer0 avatar Apr 17 '20 08:04 ForeverZer0

Create the pull request, it might be useful for others, even if it's not accepted. Having a "context' passed in to these custom allocators would be useful too (which is my case)

mobius3 avatar Nov 16 '20 21:11 mobius3

@mobius3 You make a good point. I don't believe there are any current maintainers, but I did issue the PR #16 anyways if anyone else ever stumbles across this issue and is interested.

ForeverZer0 avatar Nov 19 '20 07:11 ForeverZer0