This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Patch] Convert pool_allocator


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]