-
Notifications
You must be signed in to change notification settings - Fork 36
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
Adding support for fancy pointers and scoped_allocator_adaptors #17
base: master
Are you sure you want to change the base?
Conversation
* Started to add fancy pointer support to the sparse array class and a lot of tests to ensure that nothing is broken. * Fixxed a bug in the move construction test. * Started to work on sparse_hash * Some more changes for the iterators. * Ported the set tests to work with maps. I could have generalized the tests even more to reduce code duplication, however the tests are already complicated enough. * Integrated boost::to_address directly into the code. * A bit of tidy up. Now the fancy pointer tests are integrated into the "normal" test suit and can be compiled with C++-11. * added test for value() with fancy pointer * added missing const * Fixxed a bug in the OffsetAllocator, also did some work on erase. * added Remove_Const struct for overloading const_cast with @LukasKerk * Added the "const_cast" for boost offset pointers in its own header. * Fixed a typo in a test output. * Corrected comments. Co-authored-by: Alexander Bigerl <[email protected]>
* Initial commit. First few tests, found one problem. * Now scoped allocators can be used. However emplace still does not work as it should. * Some cleanup. * Formatting and removing comments.
BOOST_TEST_REQUIRE seems to be a pretty recent addition to the boost unittest framework. It is now replaced by BOOST_REQUIRE
Thank you very much for your contribution. I have to dig more into it but I'm a bit wary of the size of the change and maintenance burden for something that is interesting but quite niche. Would it be eventually be possible to just adapt |
* reverted whitespace changes * added typename for sparse_hash::value_type/const_pointer
Sorry for the many commits. A few of the CI problems were a bit tricky to find. |
This pull request adds support for scoped_allocator_adaptor and allocators with fancy pointers like boost offset pointers.
With these additions, it is now possible to persist the sparse_set and sparse_map via boost's interprocess. When using a stable hash function, an allocator that operates on memory mapped files can be used to store a populated sparse-hash map or set between program executions.
The scoped_allocator_adaptor is needed for nested containers. Take a set of sets of integers as an example. Before it wasn't possible to give the inner sets their own custom allocator or to give a single allocator to all sets.