From: Tom Tromey <tromey@redhat.com>
To: Pedro Alves <palves@redhat.com>
Cc: Joel Brobecker <brobecker@adacore.com>, gdb-patches@sourceware.org
Subject: Re: RFC: introduce scoped cleanups
Date: Fri, 31 May 2013 20:24:00 -0000 [thread overview]
Message-ID: <8738t2q4o2.fsf@fleche.redhat.com> (raw)
In-Reply-To: <51A8CC81.9070509@redhat.com> (Pedro Alves's message of "Fri, 31 May 2013 17:14:57 +0100")
Pedro> Seeing Tom's scope cleanups were already stack based and most of
Pedro> the way there, made me feel that it'd be a pity to be able to
Pedro> have stack-based cleanups, but then as soon as you need a real
Pedro> cleanup that does actual cleanup (as opposed to null_cleanup),
Pedro> you still need to get back to install a heap cleanup anyway.
My one concern about this code is that, if a stack cleanup should be
leaked, then any future cleanup operation will refer to invalid memory.
Right now, cleanup failures like this are a memory leak with the
possibility of wrong behavior -- but the new way seems more directly
fatal.
Another option would be to allocate cleanups on an obstack.
This would often be efficient and would avoid the above problem.
This approach would either have to still leave the special scoped
cleanup on the stack, at least when compiling with GCC (and perhaps only
if in "development=true" mode); or we would need to come up with some
extra hack to make this work properly with obstack allocation.
Tom
next prev parent reply other threads:[~2013-05-31 20:24 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-09 18:56 Tom Tromey
2013-05-30 20:09 ` Tom Tromey
2013-05-31 6:11 ` Joel Brobecker
2013-05-31 15:56 ` Tom Tromey
2013-05-31 16:15 ` Pedro Alves
2013-05-31 20:24 ` Tom Tromey [this message]
2013-06-03 6:07 ` Joel Brobecker
2013-06-05 17:44 ` Tom Tromey
2013-07-16 20:33 ` Tom Tromey
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8738t2q4o2.fsf@fleche.redhat.com \
--to=tromey@redhat.com \
--cc=brobecker@adacore.com \
--cc=gdb-patches@sourceware.org \
--cc=palves@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox