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

--- Comment #7 from Arsen Arsenović <arsen at gcc dot gnu.org> ---
(In reply to Jonathan Wakely from comment #6)
> What would be needed to work without it? It looks like the allocation would
> have to be larger so the size could be stored as a cookie at the start of
> the allocated block?
> 
> Tangentially, could _M_alloc_size use __ba - 1 instead of __ba?

would it even require that?  AIUI, that flag only affects global sized dealloc
functions, so it'd only require changing the ::operator new/delete dealloc fn
in the _Promise_alloc<void> case.  but, clang appears to intend to flip the
default soon: https://github.com/llvm/llvm-project/pull/90373 so I'm not sure
it's worth it anyway

re _M_alloc_size, do you mean _Promise_alloc<void> case or the non-void one? 
in the void case, I think so (but haven't ensured it by doing the math on paper
yet; reasoning through it, it seems fine).

in the non-void case, it might even be possible to do -2 (same disclaimer goes)

Reply via email to