From: Tom Tromey <tromey@redhat.com>
To: gdb-patches@sourceware.org
Cc: Vladimir Prus <vladimir@codesourcery.com>
Subject: Re: Value reference counting
Date: Fri, 17 Jul 2009 19:04:00 -0000 [thread overview]
Message-ID: <m3bpnj5ef3.fsf@fleche.redhat.com> (raw)
In-Reply-To: <20090717184152.GA6863@caradoc.them.org> (Daniel Jacobowitz's message of "Fri\, 17 Jul 2009 14\:41\:53 -0400")
>>>>> "Daniel" == Daniel Jacobowitz <drow@false.org> writes:
Daniel> This patch, based on an old patch from Vladimir, implements
Daniel> reference counting for values. Tom, this is the approach I
Daniel> discussed with you on IRC: instead of treating the value chain
Daniel> as a normal reference and using release_value to take
Daniel> references, this separates the value chain (which is boolean; a
Daniel> value is either on it or not) from references (which are
Daniel> counted).
Daniel> So you take a reference with value_incref. release_value
Daniel> transforms the value chain's reference into a normal reference.
Daniel> That's an entirely theoretical operation, by which I mean
Daniel> release_value doesn't have to do anything special.
Daniel> Does this look OK? Tom, will it work for the Python code?
This will work fine for Python. Also, I think that this model is
clearer than what I did.
It seems to me that at this point, release_value is doing a walk of a
linked list for no particular benefit. Suppose we deleted release_value
and replaced all calls to it with calls to value_incref?
This might result in some values living slightly longer than they
otherwise would have (they will live until free_all_values, whereas
currently they will be deleted at value_free time, which might or might
not be sooner).
The only thing I could think of is whether this would affect watchpoint
operation, since IIUC the watchpoint code examines all_values. But, if
this problem exists, it could be worked around by examining the
reference count of values on the chain.
What do you think?
Tom
next prev parent reply other threads:[~2009-07-17 18:56 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-17 19:03 Daniel Jacobowitz
2009-07-17 19:04 ` Tom Tromey [this message]
2009-07-17 19:25 ` Daniel Jacobowitz
2009-07-17 22:55 ` Tom Tromey
2009-07-20 13:30 ` Thiago Jung Bauermann
2009-07-20 13:34 ` Daniel Jacobowitz
2009-07-20 14:57 ` Thiago Jung Bauermann
2009-07-20 17:34 ` Tom Tromey
2009-07-20 19:45 ` Thiago Jung Bauermann
2009-07-20 9:55 ` Vladimir Prus
2009-07-20 13:40 ` Daniel Jacobowitz
2009-07-20 15:08 ` Vladimir Prus
2009-07-21 18:18 ` 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=m3bpnj5ef3.fsf@fleche.redhat.com \
--to=tromey@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=vladimir@codesourcery.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