Skip to content
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

Support C11 free() #51

Open
phillipjohnston opened this issue Jul 16, 2019 · 2 comments
Open

Support C11 free() #51

phillipjohnston opened this issue Jul 16, 2019 · 2 comments

Comments

@phillipjohnston
Copy link
Member

@phillipjohnston phillipjohnston commented Jul 16, 2019

With aligned_alloc() in the C11 standard, free() is called to free memory, rather than an equivalent aligned_free().

We should update our library with some logic that can be used to correctly call aligned_free() if free() is used instead.

@phillipjohnston
Copy link
Member Author

@phillipjohnston phillipjohnston commented May 7, 2020

Maybe we waste a few extra bytes in the aligned space... need a "magic" marker that indicates that this was allocated by aligned_malloc(). If the sentinel matches, then we call the aligned version.

@belmeopmenieuwesim
Copy link

@belmeopmenieuwesim belmeopmenieuwesim commented Jun 14, 2020

👍 I would be all for this. It is good to mimic how GLIBC behaves. And I don't think the costs outweigh the benefit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.