Skip to content
This repository has been archived by the owner on Sep 22, 2022. It is now read-only.

std::string shouldn't be used inside mdbx::buffer #191

Closed
erthink opened this issue May 4, 2021 · 3 comments
Closed

std::string shouldn't be used inside mdbx::buffer #191

erthink opened this issue May 4, 2021 · 3 comments
Assignees
Labels

Comments

@erthink
Copy link
Owner

erthink commented May 4, 2021

libmdbx/mdbx.h++

Lines 807 to 813 in 7d54518

/* FIXME: replace std::string with custom silo.
* The std::string<char> does not guarantee any alignment for allocated
* buffer. For instance short values may be stored within internal inplace
* buffer, which might odd address. Moreover, allocator for the `char` type
* may return unaligned/odd address. This may UB for placing a 32-bit and
* 64-bit values.
* So seems the std::string<> should be replaced with ad hoc solution. */

@erthink
Copy link
Owner Author

erthink commented May 31, 2021

This affects the alignment of a buffer(s) with the CLANG's C++ standard library.

@erthink
Copy link
Owner Author

erthink commented Jul 10, 2021

Fixed in the devel branch by bd2bb51.

@erthink
Copy link
Owner Author

erthink commented Jul 26, 2021

Fixed now in the master branch and v0.10.2.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant