Re: RFC: introduce scoped cleanups

Pedro Alves
2013-05-31T16:15:03Z

On 05/31/2013 04:56 PM, Tom Tromey wrote:
>>> Pedro said he was interested in general stack-based allocation of
>>> cleanups, so I implemented that, following his plan.
>
> Joel> Is this purely for performance?
>
> Yeah, I think so.

Yeah, like, Tom, I've occasionally found myself sometimes
considering avoiding cleanups, avoiding the heap allocations,
in cases performance may matter. Clearly we're not alone, as
evidenced from several of Tom's patches exposing spots where
we were avoiding having a "master" cleanup, some times using
tricky conditionals. I had thought of this stack cleanups
scheme before, but never actually went through with it. Seeing
Tom's scope cleanups were already stack based and most of the
way there, made me feel that it'd be a pity to be able to have
stack-based cleanups, but then as soon as you need a real cleanup
that does actual cleanup (as opposed to null_cleanup), you still
need to get back to install a heap cleanup anyway.

--
Pedro Alves