From: Joel Brobecker <brobecker@adacore.com>
To: Doug Evans <dje@google.com>
Cc: Paul Pluzhnikov <ppluzhnikov@google.com>, gdb@sourceware.org
Subject: Re: TYPE_NAME memory management
Date: Fri, 04 Sep 2009 22:44:00 -0000 [thread overview]
Message-ID: <20090904224351.GB30697@adacore.com> (raw)
In-Reply-To: <e394668d0909041417x3e65c584v7633e188bbdf4d6e@mail.gmail.com>
> Sometimes it's a string constant, sometimes it's in malloc space,
> sometimes it's on objfile's obstack, and now sometimes it can live in
> mmap'd space.
My understanding was that, if the type belongs to an objfile, then
the type name should be allocated on the objfile obstack. I know we
have types that do not belong to objfiles (types that are duplicated
from objfile types in order to preserve a value from the value history,
or gdbarch types; any others?), and these types are allocated on the
heap, including the type name, but I don't think we ever deallocate
these types.
Perhaps we might want to review all TYPE_NAME and TYPE_TAG_NAME
assignments. If there is a memory leak due to an incorrect malloc,
we might want to fix that too.
> [...] except for the new mmap'd values, so it seems like the thing to
> do for now is copy such strings onto the objfile's obstack.
This sounds right.
> I'm not sure what the speed loss will be, but I think it's the thing
> to do pending data that says something more clever is needed.
Agreed - correctness before speed :)
--
Joel
prev parent reply other threads:[~2009-09-04 22:44 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-04 21:18 Doug Evans
2009-09-04 22:42 ` Tom Tromey
2009-09-04 22:54 ` Doug Evans
2009-09-04 23:04 ` Joel Brobecker
2009-09-09 16:40 ` Doug Evans
2009-09-09 17:30 ` Paul Pluzhnikov
2009-09-09 17:38 ` Doug Evans
2009-09-09 17:46 ` Tom Tromey
2009-09-04 22:44 ` Joel Brobecker [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=20090904224351.GB30697@adacore.com \
--to=brobecker@adacore.com \
--cc=dje@google.com \
--cc=gdb@sourceware.org \
--cc=ppluzhnikov@google.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