https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64535

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
It was pointed out that the pool is very large (even if reduced to 4 entries)
and thus undesirable for TLS (would be 4k then).

An alternative is to use a free list with variable size objects, initialized
to just a single one of the emergency buffer size.  You'd split the entry
you pop off and only use a small portion of it (freeing would need to support
merging and keeping the list sorted).

Fragmentation might be an issue then, but for the case in question which
is throwing std::bad_alloc (much smaller than 1024 bytes) it might increase
the effective number of available objects enough.

Reply via email to