mirror of
https://github.com/boostorg/interprocess.git
synced 2026-01-19 04:12:13 +00:00
Use allocate_aligned in cached implementation and the allocator_v1 testing utility to support overaligned types.
This commit is contained in:
@@ -739,7 +739,8 @@ class cached_allocator_impl
|
||||
ret = m_cache.cached_allocation();
|
||||
}
|
||||
else{
|
||||
ret = this->get_segment_manager()->allocate(count*sizeof(T));
|
||||
ret = this->get_segment_manager()->allocate_aligned
|
||||
(count*sizeof(T), boost::container::dtl::alignment_of<T>::value);
|
||||
}
|
||||
return pointer(static_cast<T*>(ret));
|
||||
}
|
||||
|
||||
@@ -118,7 +118,9 @@ class allocator_v1
|
||||
if(size_overflows<sizeof(T)>(count)){
|
||||
throw bad_alloc();
|
||||
}
|
||||
(void)hint; return pointer(static_cast<T*>(mp_mngr->allocate(count*sizeof(T))));
|
||||
(void)hint;
|
||||
return pointer(static_cast<T*>
|
||||
(mp_mngr->allocate_aligned(count*sizeof(T), , boost::container::dtl::alignment_of<T>::value)));
|
||||
}
|
||||
|
||||
//!Deallocates memory previously allocated. Never throws
|
||||
|
||||
Reference in New Issue
Block a user