Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Vladimir Prus <vladimir@codesourcery.com>
To: Daniel Jacobowitz <drow@false.org>
Cc: gdb-patches@sourceware.org,  Tom Tromey <tromey@redhat.com>
Subject: Re: Value reference counting
Date: Mon, 20 Jul 2009 09:55:00 -0000	[thread overview]
Message-ID: <200907201013.36183.vladimir@codesourcery.com> (raw)
In-Reply-To: <20090717184152.GA6863@caradoc.them.org>

On Friday 17 July 2009 Daniel Jacobowitz wrote:

>         * value.c (struct value): Add reference_count field.
>         (allocate_value_lazy): Initialize reference_count.
>         (value_incref): New function.
>         (value_free): Check the reference count.
>         * value.h (value_incref): New prototype.
> 
> ---
>  gdb/value.c |   27 +++++++++++++++++++++++++++
>  gdb/value.h |    2 ++
>  2 files changed, 29 insertions(+)
> 
> Index: src/gdb/value.c
> ===================================================================
> --- src.orig/gdb/value.c        2009-07-17 09:52:16.000000000 -0400
> +++ src/gdb/value.c     2009-07-17 10:07:10.000000000 -0400
> @@ -194,6 +194,11 @@ struct value
>    /* Actual contents of the value.  Target byte-order.  NULL or not
>       valid if lazy is nonzero.  */
>    gdb_byte *contents;
> +
> +  /* The number of references to this value.  This initially includes
> +     one reference from the value chain; if release_value is called,
> +     it converts that into a normal reference.  */
> +  int reference_count;
>  };

I do not fully understand this comment, specifically the "it converts 
that into a normal reference". What is "it", what is "that" and what
is "normal reference" and where the convention happens? From your email,
I gather it's intentional that release_value does not have to be changed,
but I don't understand anything else :-( I am sure it's just me, but
a better comment would be good.

- Volodya



  parent reply	other threads:[~2009-07-20  6:13 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
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 [this message]
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=200907201013.36183.vladimir@codesourcery.com \
    --to=vladimir@codesourcery.com \
    --cc=drow@false.org \
    --cc=gdb-patches@sourceware.org \
    --cc=tromey@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