This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB 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: [OB] Add cleanup, source.c


> What's going on here is that GDB uses one construct, cleanups, to
> implement two different useful behaviors, and does so in a perilous
> way.
> where 'cleanup_success' discards failure handlers and runs finally
> handlers.  The 'error' function would call a companion to that named
> 'cleanup_on_failure', which runs both finally and failure handlers.

A very interesting analysis, Jim. I confess that up to today, I have
been using the two concepts interchangeably, so I'm pretty sure that
I have introduced the potential for memory leaks :-(.

> So.  Only 270 calls to 'do_cleanups' and 47 calls to
> 'discard_cleanups' to examine.

Good luck. Let me know if you'd like some help, I feel partly responsible
for the mess. We can split the number of files that need to be inspected.

-- 
Joel


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