mirror of
https://github.com/boostorg/container.git
synced 2025-08-02 14:04:26 +02:00
Use more correct code in allocate_many
This commit is contained in:
@@ -284,7 +284,7 @@ class allocator
|
|||||||
//!This function is available only with Version == 2
|
//!This function is available only with Version == 2
|
||||||
void allocate_many(size_type elem_size, std::size_t n_elements, multiallocation_chain &chain)
|
void allocate_many(size_type elem_size, std::size_t n_elements, multiallocation_chain &chain)
|
||||||
{
|
{
|
||||||
BOOST_STATIC_ASSERT(( Version > 1 ));/*
|
BOOST_STATIC_ASSERT(( Version > 1 ));
|
||||||
dlmalloc_memchain ch;
|
dlmalloc_memchain ch;
|
||||||
BOOST_CONTAINER_MEMCHAIN_INIT(&ch);
|
BOOST_CONTAINER_MEMCHAIN_INIT(&ch);
|
||||||
if(!dlmalloc_multialloc_nodes(n_elements, elem_size*sizeof(T), DL_MULTIALLOC_DEFAULT_CONTIGUOUS, &ch)){
|
if(!dlmalloc_multialloc_nodes(n_elements, elem_size*sizeof(T), DL_MULTIALLOC_DEFAULT_CONTIGUOUS, &ch)){
|
||||||
@@ -293,10 +293,11 @@ class allocator
|
|||||||
chain.incorporate_after(chain.before_begin()
|
chain.incorporate_after(chain.before_begin()
|
||||||
,(T*)BOOST_CONTAINER_MEMCHAIN_FIRSTMEM(&ch)
|
,(T*)BOOST_CONTAINER_MEMCHAIN_FIRSTMEM(&ch)
|
||||||
,(T*)BOOST_CONTAINER_MEMCHAIN_LASTMEM(&ch)
|
,(T*)BOOST_CONTAINER_MEMCHAIN_LASTMEM(&ch)
|
||||||
,BOOST_CONTAINER_MEMCHAIN_SIZE(&ch) );*/
|
,BOOST_CONTAINER_MEMCHAIN_SIZE(&ch) );
|
||||||
|
/*
|
||||||
if(!dlmalloc_multialloc_nodes(n_elements, elem_size*sizeof(T), DL_MULTIALLOC_DEFAULT_CONTIGUOUS, reinterpret_cast<dlmalloc_memchain *>(&chain))){
|
if(!dlmalloc_multialloc_nodes(n_elements, elem_size*sizeof(T), DL_MULTIALLOC_DEFAULT_CONTIGUOUS, reinterpret_cast<dlmalloc_memchain *>(&chain))){
|
||||||
boost::container::throw_bad_alloc();
|
boost::container::throw_bad_alloc();
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
|
|
||||||
//!Allocates n_elements elements, each one of size elem_sizes[i]
|
//!Allocates n_elements elements, each one of size elem_sizes[i]
|
||||||
|
Reference in New Issue
Block a user