Commit Graph

16 Commits

Author SHA1 Message Date
Ion Gaztañaga
f29a4c8248 Make new_delete_resource_imp and null_memory_resource_imp "final" 2025-12-23 11:07:04 +01:00
Ion Gaztañaga
e4fcf4b862 Add overaligned type support for global pmr: implement operator_new_raw_allocate/operator_delete_raw_deallocate and use them in new_delete_resource_imp 2025-12-23 11:02:38 +01:00
Ion Gaztañaga
552688c7fc Simplify dependencies dropping Boost.Core 2023-02-01 23:00:23 +01:00
Ion Gaztañaga
e9b09a5ee7 Use direct-initialization since copy-initialization invokes the copy ctor in older standard versions 2022-12-11 20:36:28 +01:00
Yuriy Chernyshov
488500ed85 Fix using pmr::polymorphic_allocator in pre-main
A similar problems for the above (i. e. non-atomic) branch was addressed in #148, yet the default C++11 branch causes segault with the following stacktrace:

```
(gdb) bt
#0  0x000000000e1c3d28 in boost::container::pmr::memory_resource::allocate (this=0x0, bytes=92, alignment=4)
    at boost/container/include/boost/container/pmr/memory_resource.hpp:48
#1  0x000000000e2e9e59 in boost::container::pmr::polymorphic_allocator<float>::allocate (this=0x7fffffffd148, n=23)
    at boost/container/include/boost/container/pmr/polymorphic_allocator.hpp:92
#2  0x000000000e2e9cdd in std::__y1::allocator_traits<boost::container::pmr::polymorphic_allocator<float> >::allocate (__a=..., __n=23)
    at libcxx/include/__memory/allocator_traits.h:262
#3  0x000000000e2e9b13 in std::__y1::vector<float, boost::container::pmr::polymorphic_allocator<float> >::__vallocate (this=0x7fffffffd130, __n=23)
    at libcxx/include/vector:958
#4  0x000000000e33c591 in std::__y1::vector<float, boost::container::pmr::polymorphic_allocator<float> >::vector (this=0x7fffffffd130, __n=23)
    at libcxx/include/vector:1106
```
2022-10-01 11:24:42 +02:00
Ion Gaztañaga
231dd48e70 Fixes #211 ("Use atomics for pmr get/set default resource") 2022-07-25 01:28:58 +02:00
Ion Gaztañaga
42e7aaecec Fixes #200 (Warning) 2021-11-17 15:33:04 +01:00
Ion Gaztañaga
d5a830434e - Replaced default standard exception classes with Boost.Container own classes, reducing considerably the included files overhead 2020-12-30 15:07:32 +01:00
Ion Gaztañaga
39edf046d5 Additional fix for #148 ("Fix static initialization issues in pmr global resources") in set_default_resource 2020-05-24 19:00:19 +02:00
Ion Gaztañaga
eff9bdfdaa Fixes #148 again (Fix static initialization issues in pmr global resources) 2020-05-24 00:37:36 +02:00
Ion Gaztañaga
4548ddacf7 Merge branch 'develop' into use-boost-override 2020-05-23 23:42:15 +02:00
Ion Gaztañaga
093467e1d3 Fixes #148 (Fix static initialization issues in pmr global resources) 2020-05-23 23:38:58 +02:00
Eugene Zelenko
811dc94bb4 Use BOOST_OVERRIDE to fix GCC -Wsuggest-override and Clang-tidy modernize-use-override warnings. 2020-05-08 09:28:49 -07:00
Ion Gaztañaga
a9ceb4d9c6 Better use forward declarations and export symbols 2019-01-03 03:32:03 +01:00
Miro Knejp
bf25231d5d Avoid -Wunreachable-code in do_allocate()
do_allocate() triggered the warning
"code will never be executed [-Wunreachable-code]"
in Clang.

Changed both do_allocate and do_deallocate to keep the existing
similarity.
2016-11-02 13:43:34 +01:00
Ion Gaztañaga
33d2f0f7af Add Polymorphic Memory Resource utilities and rework the separately compiled library:
- Dlmalloc's based C function are boost_cont_xxx no longer exported, but wrapped into C++ linkage dlmalloc_xxx functions to effectively reuse Boost's dynamic library and autolink machinery instead of rewriting machinery to compile the C source file.
- Refactored scoped_allocator_adaptor's construct logic as it was shared with polymorphic allocator's one. Moved common logic to detail/dispatch_uses_allocator.hpp. Refactored also scoped_allocator_adaptor test utilities to be reused with polymorphic_allocator tests.
2015-09-07 19:16:46 +02:00