Boost logo

Boost Users :

From: scleary_at_[hidden]
Date: 2003-04-11 10:33:50


> -----Original Message-----
> From: Ilya Chvetsov(work) [mailto:chvetsov_at_[hidden]]
>
> Hi!
> I try to use boost::pool_alloc with STLport-4.5-0119 snapshot.
> STLPort call pool_alloc::allocate(const size_type n) with n = 0.
> STLPort naitive allocator returns in such case NULL, but pool_alloc
> tries return memory.

Hmmm... You seem to have uncovered a corner case, not covered by the
Standard requirements. I will change the pool_allocator (and
fast_pool_allocator) to be able to handle this by returning NULL.

> Method simple_segregated_storage<SizeType>::try_malloc_n(
> void * & start, size_type n, const size_type partition_size) has
> problem too if parameter n is 0. Problem is in while condition:
> while (--n != 0)...

This is correct; (n > 0) is a precondition for that function.

        -Steve


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net