Peter Dimov
b550e028f5
Move boost/memory_order.hpp to Boost.Atomic
2014-05-20 23:33:03 +03:00
Glen Fernandes
d523c3423e
Use Boost.Align for alignment
2014-05-04 08:20:37 -07:00
Glen Fernandes
1968d17d2f
Use add_rvalue_reference in make_unique overload
2014-03-12 20:27:36 -07:00
Andrey Semashev
d586469d60
Fix warnings about struct/class mismatch
...
ms_allocator_state template was declared as class but its specializations were as structs. This caused Clang 3.2 warnings. The commit changes ms_allocator_state declaration to struct to fix that.
2014-03-08 18:31:31 +03:00
Peter Dimov
fbb851097f
Disable the std::atomic spinlock implementation on Clang
2014-03-01 02:14:56 +02:00
Glen Fernandes
75add10b1d
Simplify ms_allocator and as_allocator design
2014-02-28 10:19:50 -08:00
Peter Dimov
3e625c07e8
Switch to sp_interlocked.hpp
2014-02-25 01:32:19 +02:00
Glen Fernandes
75cab39801
Drop the BOOST_NO_CXX11_STD_ALIGN-undefined path
...
Until the merge of Boost.Config develop to master
2014-02-24 08:35:59 -08:00
Glen Fernandes
38cb523713
Derive empty base optimization from rebound allocator
2014-02-18 00:16:57 -08:00
Glen Fernandes
5f1d4eae4f
Factor out alignment code into sp_align
2014-02-16 12:15:29 -08:00
Glen Fernandes
adc0cdddff
Make as_allocator::deallocate consistent
2014-02-14 18:31:52 -08:00
Glen Fernandes
8c9e8b5556
Further simplification of ms_allocator
2014-02-12 22:15:15 -08:00
Glen Fernandes
d9333e5375
Simplify array_allocator; update documentation
2014-02-12 19:34:56 -08:00
Glen Fernandes
3d279e6c6d
Save additional sizeof(void*) bytes for arrays
2014-02-12 13:52:58 -08:00
Peter Dimov
c003fba3a0
Renamed, cleaned up interlocked.hpp; added test
2014-02-12 20:48:35 +02:00
Peter Dimov
0c29e86728
Add spinlock_std_atomic.hpp
2014-02-12 20:20:56 +02:00
Glen Fernandes
016af907bd
Make sp_counted_impl_ specialization more generic
2014-02-12 08:46:59 -08:00
Peter Dimov
208bfd78f9
Move interlocked.hpp to smart_ptr/detail
2014-02-12 16:42:24 +02:00
Glen Fernandes
7ce5b6b2a9
Fix use of ms_init in no C++11 allocator case
2014-02-11 08:39:52 -08:00
Glen Fernandes
7e3ae44bc2
Fix use of size in make_shared for arrays
2014-02-10 21:09:13 -08:00
Glen Fernandes
57dc400fbf
Cosmetic changes in make_shared and make_unique
2014-02-10 21:04:41 -08:00
Glen Fernandes
5f485c2952
Spatial optimization for make_shared for arrays
...
Saves up to sizeof(void*) + sizeof(size_t) bytes for make_shared and saves
sizeof(void*) + sizeof(size_t) + sizeof(A) bytes for allocate_shared where A is the
supplied allocator type.
2014-02-10 20:54:48 -08:00
Glen Fernandes
54fb49a5be
Use typedef A1 (warnings about unused typedefs)
2014-02-09 11:27:22 -08:00
Glen Fernandes
c23bd41c44
Refactor make_shared for arrays
...
Refactor implementation to later simplify making an optimization [for the C++11
allocator case] for when sp_counted_impl_pda destruction invokes the
allocator's destroy function instead of the type's destructor.
2014-02-07 08:03:47 -08:00
Peter Dimov
a64cc5c41c
Use allocator)traits<>::destroy in sp_counted_impl_pda::destroy
2014-02-07 17:37:00 +02:00
Glen Fernandes
d46e3c7cbd
Simplify/tidy array_allocator and array_deleter
2014-02-06 01:38:58 -08:00
Glen Fernandes
6d73b4aa54
Work around VC11 which has broken rebind_traits
...
VC11 has only partial support for C++11 allocators. For example it has a
non-conforming rebind_alloc and rebind_traits in std::allocator_traits
because it does not support C++11 template aliases.
2014-02-04 23:56:34 -08:00
Peter Dimov
9f5822f427
Add support and test for C++11 construct/destroy in allocate_shared
2014-02-05 02:31:33 +02:00
Peter Dimov
d229ae870c
Subsume zero-argument overload into the variadic one
2014-02-05 01:04:20 +02:00
Glen Fernandes
3ac6dbbf08
Make detail::as_allocator template C++11 friendly
2014-02-04 15:00:24 -08:00
Peter Dimov
af5141d492
Merge commit
2014-02-05 00:32:36 +02:00
Peter Dimov
90e74511f7
Add support and tests for C++11 minimal allocators
2014-02-05 00:17:34 +02:00
Glen Fernandes
51ab46a07d
Fix use of rebind_traits and rebind_alloc
2014-02-04 12:42:10 -08:00
Glen Fernandes
e8595a05af
Fix use of rebind_traits and rebind_alloc
2014-02-04 08:43:36 -08:00
Glen Fernandes
154a274916
Update make_shared for arrays to address 2070
...
This updates make_shared and allocate_shared for arrays in accordance with
report 2070 which requires that allocator_traits<A2>::construct(a2, ptr,
...) is used for construction and allocator_traits<A2>::destroy(a2, ptr)
is used for destruction instead of placement new and destructor
invocation.
2014-02-04 04:46:03 -08:00
Glen Fernandes
63a05a3576
Refactor make_array_helper and array_deleter
...
Reduce the amount of code in allocate_array_helper, make_array_helper, and
array_deleter using the empty base class optimization technique.
2014-02-03 07:28:01 -08:00
Glen Fernandes
72e5fb6fd7
Add fourth form of make_unique for objects
...
To support initialization syntax that Args&&... cannot forward perfectly.
2014-01-29 17:16:01 -08:00
Glen Fernandes
7806737b52
Add make_unique for arrays and objects
2014-01-28 03:58:51 -08:00
Glen Fernandes
87e5debdc2
Minor cosmetic changes in make_shared for arrays
2014-01-28 03:40:54 -08:00
Glen Fernandes
630e4f49f3
Update make_shared for arrays to conform to N3870
...
Update make_shared and allocate_shared for arrays to be confined to the
set of overloads specified in N3870.
2014-01-23 20:40:46 -08:00
Peter Dimov
4de3f36839
Add add_ref parameter to intrusive_ptr::reset, add tests for reset.
2013-12-26 18:47:05 +02:00
Avi Kivity
73153d5797
Add intrusive_ptr<>::detach()
...
This provides a way to escape from automatic reference counting, and taking
manual control of the reference. Useful when interfacing to a C API that
expects a pointer with an elevated reference count.
Similar to std::unique_ptr<>::release().
2013-12-26 17:47:28 +02:00
Peter Dimov
d7fa365843
Remove obsolete _nmt headers.
2013-12-14 00:15:51 +02:00
Peter Dimov
6e0ee30543
Update atomic_count.hpp to match sp_counted_base.hpp.
2013-12-14 00:01:01 +02:00
Peter Dimov
fed15ad8c5
Add support for BOOST_SP_USE_STD_ATOMIC
2013-12-13 22:58:09 +02:00
Peter Dimov
bba3b446bd
Check return values of pthread_* calls with BOOST_VERIFY, per #8898
2013-12-12 02:36:33 +02:00
Peter Dimov
4c8a558982
Check return values of pthread_* calls with BOOST_VERIFY, per #8904 .
2013-12-12 01:42:16 +02:00
Peter Dimov
a41b81f1c8
Added shared_array constructor from nullptr, per #8894 .
2013-12-12 01:22:51 +02:00
Peter Dimov
a4f853bfbc
Revert "SmartPtr: Remove obsolete MSVC version checks."
...
This reverts commit 7d1c527ac0 .
2013-12-07 19:25:05 +02:00
Peter Dimov
832ed079b9
Revert "Revert MSC_VER changes."
...
This reverts commit 382fb54a52 .
2013-12-07 19:24:44 +02:00