[Patch] Convert pool_allocator
Paolo Carlini
pcarlini@suse.de
Mon Mar 22 10:25:00 GMT 2004
Dhruv Matani wrote:
>I have a few things to say:
>
>1. This allocator maintains a per-type pool as opposed to a global only
>one pool for all types scheme, which I suspect was the original
>intention.
>
>
Right. Doesn't seem a bad idea, anyway...
>2. The check in the allocate function for __n could be removed, because
>the standard does not say anything, so we may assume undefined behaviour
>if __n is 0.
>
>
Let's keep it, was already there and makes allocate and deallocate more
consistent.
>3. There is a line:
>if (__builtin_expect(__ret == 0, 0))
>__throw_bad_alloc();
>
>
Same, was already there. Let's keep the old behavior for now.
Paolo.
More information about the Libstdc++
mailing list