Skip to content

Conversation

romange
Copy link
Contributor

@romange romange commented May 10, 2024

Fixes #509

Signed-off-by: Roman Gershman <romange@gmail.com>
@danielaparker
Copy link
Owner

Thanks!

Line 147

if (reinterpret_cast<uintptr_t>(ptr) % align == 0)

will fail compilation if ptr is a "fancy pointer". I don't have a test case for that, but you'll see it if you try to compile boost_examples/interprocess_allocator/shared_memory.cpp. I think you need to write it as

q = extension_traits::to_plain_pointer(ptr);
if (reinterpret_cast<uintptr_t>(q) % align == 0) {

Line 157

align_pad = (align-1);

requires a cast to suppress a warning.

Signed-off-by: Roman Gershman <romange@gmail.com>
@romange
Copy link
Contributor Author

romange commented May 16, 2024

@danielaparker PTAL

@danielaparker danielaparker merged commit 0be3e70 into danielaparker:master May 20, 2024
@danielaparker
Copy link
Owner

Thanks for contributing

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.

avoid over-allocatng memory due to alignment constraints
2 participants