Skip to content

Conversation

jodyhagins
Copy link

For the segregator, it checks the size of the allocation. However, some allocators (I'm looking at you,
memory_pool_collection_allocator) throw if the requested alignment is too big. However, the segregator could have a fallback allocator that supports the larger alignment.

If we just made a hard change, this could break existing code. Thus, another parameter can be passed to the threshold constructor that can enable alignment checking. It is a strong type so there should be no inconvenient implicit conversions and in order to get the new behavior, it will have to be explicitly requested.

For the segregator, it checks the size of the allocation.
However, some allocators (I'm looking at you,
memory_pool_collection_allocator) throw if the requested alignment
is too big. However, the segregator could have a fallback allocator
that supports the larger alignment.

If we just made a hard change, this could break existing code.
Thus, another parameter can be passed to the threshold constructor
that can enable alignment checking. It is a strong type so there
should be no inconvenient implicit conversions and in order to
get the new behavior, it will have to be explicitly requested.
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.

1 participant