From: Jim Blandy <jimb@codesourcery.com>
To: gdb-patches@sourceware.org
Subject: Re: [rfc] Plug memory leaks during gdbarch initialization
Date: Tue, 23 Jan 2007 15:25:00 -0000 [thread overview]
Message-ID: <m3irexvk8i.fsf@codesourcery.com> (raw)
In-Reply-To: <20070123144523.GA6339@nevyn.them.org> (Daniel Jacobowitz's message of "Tue, 23 Jan 2007 09:45:23 -0500")
Daniel Jacobowitz <drow@false.org> writes:
> The patch is an improvement, but doesn't fix that wart. I don't really
> want to check it in without fixing the underlying problem but I don't
> see a good way... anyone have a suggestion?
I could imagine having each file's _initialize function start with:
void
_initialize_foo (void)
{
static initialized;
if (initialized)
return;
initialized = 1;
...
}
A sed script could get the job done. Then, they could call each other
with wild abandon. For extra points, you could do:
void
_initialize_foo (void)
{
static int initialized;
assert (initialized != 1);
if (initialized)
return;
initialized = 1;
...
initialized = 2;
}
So you'd catch circular dependencies.
next prev parent reply other threads:[~2007-01-23 15:25 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-01-23 14:45 Daniel Jacobowitz
2007-01-23 15:25 ` Jim Blandy [this message]
2007-01-23 17:17 ` Daniel Jacobowitz
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=m3irexvk8i.fsf@codesourcery.com \
--to=jimb@codesourcery.com \
--cc=gdb-patches@sourceware.org \
/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