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

Add checks for deallocation with size #160

Merged
merged 3 commits into from
Apr 2, 2020
Merged

Conversation

mjp41
Copy link
Member

@mjp41 mjp41 commented Mar 31, 2020

Ensure that the size deallocated with is the correct size. If the size
supplied is wrong, then internal invariants can break.

Ensure that the size deallocated with is the correct size. If the size
supplied is wrong, then internal invariants can break.
src/mem/alloc.h Outdated
@@ -210,6 +210,24 @@ namespace snmalloc
UNUSED(size);
return free(p);
#else
# if defined(CHECK_CLIENT)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this duplicated code be pulled into a separate (inline) function?

@mjp41 mjp41 mentioned this pull request Apr 2, 2020
@mjp41 mjp41 merged commit 7bb00a7 into microsoft:master Apr 2, 2020
@mjp41 mjp41 deleted the check_size branch April 2, 2020 06:04
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