On 01/12/2013 04:05 PM, Amos Jeffries wrote: > On 13/01/2013 6:51 a.m., Alex Rousskov wrote: >> While you are documenting, it may be a good idea to explain that we zero >> on push because we are afraid of broken code using stale/dirty data >> after the memory was returned to the pool. If we were not afraid of >> that, we would zero on allocate() instead!
> Will do. > > I think we do not need to have that worry anymore with the C++ compiler > and Coverity use-after-free checks. Do you agree? I do not know. However, if we do have code accessing free memory, I think it may be better to let that code crash or misbehave than to continue hiding such accesses from ourselves. The third patch version look OK to me (although I would probably keep zeroBlocks(bool) setter non-inlined). If you decide to switch to the zero-on-allocate path, your patch will need to be adjusted again, of course! Thank you, Alex.
