Skip to content

Small refactoring of code for finding a sizeclass for an alignment #111

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

Merged
merged 2 commits into from
Jan 10, 2020

Conversation

mjp41
Copy link
Member

@mjp41 mjp41 commented Jan 9, 2020

snmalloc has natural alignment for each sizeclass, this means that we can search for a sizeclass larger then the requested sizeclass whose natural alignment meets that specified by the call.

This is currently used in a single place, so was directly written into memalign. With #109 there is a wish to make a larger API surface that supports alignment. This PR is intended to make that easier.

@mjp41
Copy link
Member Author

mjp41 commented Jan 9, 2020

CC: @SchrodingerZhu This may help your Rust efforts.

mjp41 added 2 commits January 9, 2020 16:54
Previous implementation of aligned_alloc met the specification, but was
not particularly useful.  This uses the same implementation for
alligned_alloc and memalign.
Copy link
Contributor

@Theodus Theodus left a comment

Choose a reason for hiding this comment

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

LGTM

@mjp41 mjp41 merged commit 49667c9 into master Jan 10, 2020
@mjp41 mjp41 deleted the align branch January 16, 2020 13:42
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