From: Tom Tromey <tromey@redhat.com>
To: Jan Kratochvil <jan.kratochvil@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [patch] [5/5] Types reference counting [value_history_cleanup]
Date: Thu, 16 Apr 2009 22:09:00 -0000 [thread overview]
Message-ID: <m34owocktg.fsf@fleche.redhat.com> (raw)
In-Reply-To: <20090413124354.GA13859@host0.dyn.jankratochvil.net> (Jan Kratochvil's message of "Mon\, 13 Apr 2009 14\:43\:54 +0200")
>>>>> "Jan" == Jan Kratochvil <jan.kratochvil@redhat.com> writes:
Jan> There is now a fix to free anything at all. When the function
Jan> was written there was an older implementation of type_decref
Jan> which was incorrectly freeing the zero-reference-count types
Jan> immediately (and not just on the garbage collection by
Jan> free_all_types).
Jan> gdb/
Jan> 2009-04-13 Jan Kratochvil <jan.kratochvil@redhat.com>
Jan> * value.c (value_history_cleanup): New function.
Jan> (_initialize_values): Setup a value_history_cleanup final call.
I don't generally like to add work on the exit path.
So, I think your initial comment was on target -- we should have some
kind of checking mode that enables this; and then do like GCC and
arrange to have it enabled in non-release builds.
Jan> +/* Sanity check for memory leaks and proper types reference counting. */
Jan> +
Jan> +static void
Jan> +value_history_cleanup (void *unused)
Jan> +{
This should probably free values_in_python as well.
I don't think we have a convenient way to destroy all the types
referenced by Type objects, but perhaps we ought to add one for this.
Tom
prev parent reply other threads:[~2009-04-16 22:09 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-11 10:22 Jan Kratochvil
2009-04-13 12:44 ` Jan Kratochvil
2009-04-16 22:09 ` Tom Tromey [this message]
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=m34owocktg.fsf@fleche.redhat.com \
--to=tromey@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=jan.kratochvil@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