mirror of
https://github.com/boostorg/container.git
synced 2026-01-29 09:50:22 +01:00
- Modify dlmalloc_allocation_command to use alignment info, this requires modifying the dlmalloc_ext wrapper library.
- Replace all dlmalloc_malloc uses with dlmalloc_allocation_command to support overaligned types in array allocations.
This commit is contained in:
@@ -112,10 +112,9 @@ struct GetAllocatorCont
|
||||
template<class ValueType>
|
||||
struct apply
|
||||
{
|
||||
typedef vector< ValueType
|
||||
, typename allocator_traits<VoidAllocator>
|
||||
::template portable_rebind_alloc<ValueType>::type
|
||||
> type;
|
||||
typedef typename allocator_traits<VoidAllocator>
|
||||
::template portable_rebind_alloc<ValueType>::type rebound_allocator_type;
|
||||
typedef vector< ValueType, rebound_allocator_type> type;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -127,6 +126,7 @@ int test_cont_variants()
|
||||
typedef typename GetAllocatorCont<VoidAllocator>::template apply<test::movable_and_copyable_int>::type MyCopyMoveCont;
|
||||
typedef typename GetAllocatorCont<VoidAllocator>::template apply<test::copyable_int>::type MyCopyCont;
|
||||
typedef typename GetAllocatorCont<VoidAllocator>::template apply<test::moveconstruct_int>::type MyMoveConstructCont;
|
||||
typedef typename GetAllocatorCont<VoidAllocator>::template apply<test::overaligned_copyable_int>::type MyOverAlignCont;
|
||||
|
||||
if (test::vector_test<MyCont>())
|
||||
return 1;
|
||||
@@ -138,7 +138,11 @@ int test_cont_variants()
|
||||
return 1;
|
||||
if (test::vector_test<MyMoveConstructCont>())
|
||||
return 1;
|
||||
|
||||
#if !defined(__cpp_aligned_new) //old std::allocators don't support overaligned types
|
||||
BOOST_IF_CONSTEXPR(!dtl::is_same<typename MyCont::allocator_type, std::allocator<int> >::value)
|
||||
#endif
|
||||
if (test::vector_test<MyOverAlignCont>())
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -276,6 +280,11 @@ int main()
|
||||
std::cerr << "test_cont_variants< allocator<void> > failed" << std::endl;
|
||||
return 1;
|
||||
}
|
||||
// boost::container::new_allocator
|
||||
if(test_cont_variants< new_allocator<void> >()){
|
||||
std::cerr << "test_cont_variants< allocator<void> > failed" << std::endl;
|
||||
return 1;
|
||||
}
|
||||
|
||||
{ //Test enum container
|
||||
typedef vector<Test, std::allocator<Test> > MyEnumCont;
|
||||
|
||||
Reference in New Issue
Block a user