Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Eli Zaretskii" <eliz@is.elta.co.il>
To: kevinb@cygnus.com
Cc: gdb-patches@sources.redhat.com
Subject: Re: [PATCH RFC] process/thread/lwp id patch - phase 3
Date: Fri, 04 May 2001 07:39:00 -0000	[thread overview]
Message-ID: <1190-Fri04May2001173922+0300-eliz@is.elta.co.il> (raw)
In-Reply-To: <1010504090641.ZM7298@ocotillo.lan>

> Date: Fri, 4 May 2001 02:06:41 -0700
> From: Kevin Buettner <kevinb@cygnus.com>
> 
> I know from conversations with some of my colleagues that this
> representation is not unanimously favored.  One of the alternate
> suggestions was to make struct ptid somewhat more opaque by making it
> more difficult to associate meaning with the various components.  (I
> guess this could be called "opacity through obscurity".)  Such a
> representation might look like this:
> 
>     struct ptid
>       {
>         long ids[3];
>       }

I don't like such techniques.  They don't really work (how many
seconds will it take to understand what does each element of ids[]
serve for?).

I think it's good enough to encapsulate access to these entities in a
bunch of functions, like you did, and leave the rest to be enforced by
the coding standards.

Plus, we can add something to the ARI script to help reveal any
``bad'' practice that succeeds to sneak in, if that's a real danger.

> +int
> +ptid_equal (ptid_t ptid1, ptid_t ptid2)
> +{
> +  return (ptid1.pid == ptid2.pid && ptid1.lwp == ptid2.lwp
> +          && ptid1.tid == ptid2.tid);
> +}

You could have passed pointers to the objects instead, and gain a bit
more performance.  In particular, you could compare the pointers
first, and if they are equal, skip the rest.  But that is not a very
important consideration, I think.


  reply	other threads:[~2001-05-04  7:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-05-04  2:07 Kevin Buettner
2001-05-04  7:39 ` Eli Zaretskii [this message]
2001-05-14 17:08 ` Kevin Buettner

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=1190-Fri04May2001173922+0300-eliz@is.elta.co.il \
    --to=eliz@is.elta.co.il \
    --cc=gdb-patches@sources.redhat.com \
    --cc=kevinb@cygnus.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