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

Standard compliant std::realloc #22

Merged
merged 1 commit into from
Feb 15, 2025

Conversation

BikingGlobetrotter
Copy link
Contributor

Hi, I am Michael and I am using wrenbind17 (thanks for providing it).
This is my first contribution to make it an even better library (others may follow ;-) ):

I noticed that std::realloc is called inside reallocateFn even if the size is 0.
According to C++ standard ( https://en.cppreference.com/w/cpp/memory/c/realloc ),
the behavior in that case in implementation defined and its usage is discouraged.
Instead it is recommend to call std::free instead (which is also the default implementation inside wren).

Please find my merge request that improves the code in this regard.
Best regards
Michael

@matusnovak
Copy link
Owner

Hi Michael. Thank you for your contribution!

I have enabled GitHub actions. Linux x64 build failed for unrelated reasons, don't worry about it.

Merging.

@matusnovak matusnovak merged commit 5fff54a into matusnovak:master Feb 15, 2025
4 of 5 checks passed
@matusnovak
Copy link
Owner

I have created a new tag: https://github.com/matusnovak/wrenbind17/releases/tag/v1.3.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants