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

Debug allocator should always abort #104

Merged
merged 1 commit into from Jun 29, 2015
Merged

Conversation

dcreager
Copy link
Owner

We provide a "debug" allocator, which verifies that the sizes that you provide to the allocation functions matches the sizes that you provide to the deallocation functions. Before, we used the builtin assert macro to perform this check. However, that means that if we compile libcork in Release mode (in which asserts are left out), we never actually perform the check! We now use an explicit check, and call abort ourselves if the check fails — our assumption being that if you ask for the debug allocator, you want at least this particular bit of debug behavior even if the rest of the library was compiled in Release mode.

We provide a "debug" allocator, which verifies that the sizes that you
provide to the allocation functions matches the sizes that you provide
to the deallocation functions.  Before, we used the builtin `assert`
macro to perform this check.  However, that means that if we compile
libcork in `Release` mode (in which asserts are left out), we never
actually perform the check!  We now use an explicit check, and call
`abort` ourselves if the check fails — our assumption being that if you
ask for the debug allocator, you want at least this particular bit of
debug behavior even if the rest of the library was compiled in `Release`
mode.
dcreager pushed a commit that referenced this pull request Jun 29, 2015
Debug allocator should always abort
@dcreager dcreager merged commit 1ccea38 into develop Jun 29, 2015
@dcreager dcreager deleted the feature/debug-assert branch June 29, 2015 14:19
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.

None yet

1 participant