Skip to content

port_posix: use posix_memalign() for aligned_alloc - #36

Closed
tchaikov wants to merge 1 commit into
masterfrom
ceph-mimic
Closed

tchaikov wants to merge 1 commit into
masterfrom
ceph-mimic

Conversation

@tchaikov

Copy link
Copy Markdown

to workaround issue of http://tracker.ceph.com/issues/21422 .
and by using C++17, we can use this new "new" operator. and to be
consistent with the C++17 consumer of this library.

Signed-off-by: Kefu Chai [email protected]

@tchaikov

Copy link
Copy Markdown
Author

@jdurgin @liewegas this change is for review only, because i pushed this change to https://github.com/ceph/rocksdb/tree/ceph-mimic . so we can use it to track changes on rocksdb side for mimic.

to workaround issue of http://tracker.ceph.com/issues/21422 .
and in tcmalloc aligned_alloc and posix_memalign() are basically the
same thing. the same applies to GNU glibc.

Signed-off-by: Kefu Chai <[email protected]>
@tchaikov tchaikov changed the title port_posix: use new(size, std::align_val_t) for aligned_alloc port_posix: use posix_memalign() for aligned_alloc Apr 25, 2018
@tchaikov

Copy link
Copy Markdown
Author

changelog

  • the GNU libstdc++'s implementation of new(size, std::align_val_t) is actually using aligned_alloc(), so fall back to posix_memalign(). i read the tcmalloc and glibc's implementations, aligned_alloc() is basically an alias of posix_memalign() just for ISO C11 compliance.

@tchaikov tchaikov closed this Apr 25, 2018
@tchaikov

tchaikov commented Apr 25, 2018 •

Copy link
Copy Markdown
Author

please do not delete this branch as it is used by the mimic branch.

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