9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Charles Forsyth <forsyth@terzarima.net>
To: 9fans@cse.psu.edu
Subject: Re: [9fans] Sleep-complexity
Date: Mon,  9 May 2005 15:03:07 +0100	[thread overview]
Message-ID: <c2e8cb507a9a11e9e25caab353d1c6f6@terzarima.net> (raw)
In-Reply-To: <427F65A6.2010803@9fs.org>

i'd suspect that the gcc 64-bit long forces more changes than the other approach,
because i tried both with plan 9, and subsequently looked at a fair bit of non-plan9 code.

in fact, i tried x86_64's approach first for just the reason given:
code that fiddles with pointers as ints (in plan 9) often uses ulong,
though not invariably so, and having long as 64 bits keeps that code working.

as it turns out, relatively few things these days--certainly in plan 9--
fiddle with pointers as integers (directly, that is, not say through varargs).
those can be found by the compiler (as gcc does with pointer -> int on amd64).
by contrast, it's very hard for a compiler to find, reliably, instances
where long is assumed to be 32 bits.  bitmasks, loop bounds, ...
there are surprisingly many, things break weirdly, often obscurely,
or just on boundary cases, and having found myself in a world of pain...
i changed my mind.  all is relative sweetness and light.
at least the compiler moans instead of me.

non-plan9 code might go a little better because most of (say) the FSF
code probably assumes int is 32, so programmers typically
put the subtle 32-bit assumptions on `int', not `long'.
thus when long changes, it's less troublesome.
even so, quite a few do use long in contexts where 64-bits is not particularly useful,
probably not intended, and 32 bits would be a better representation.



  reply	other threads:[~2005-05-09 14:03 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-08 12:03 Christoph Lohmann
2005-05-08 12:51 ` Sergey Reva
2005-05-08 16:50   ` Russ Cox
2005-05-08 17:28     ` Dan Cross
2005-05-08 18:56       ` jmk
2005-05-08 19:21         ` Bruce Ellis
2005-05-08 20:54           ` Charles Forsyth
2005-05-08 21:06             ` Charles Forsyth
2005-05-08 22:40         ` Dan Cross
2005-05-08 22:59           ` geoff
2005-05-09  7:28             ` Richard Miller
2005-05-09 13:14             ` Brantley Coile
2005-05-09 16:45             ` Mike Haertel
2005-05-09 20:10               ` Bruce Ellis
2005-05-09 22:46                 ` Charles Forsyth
2005-05-09  7:41           ` David Tolpin
2005-05-08 21:12       ` Charles Forsyth
2005-05-09 13:29         ` Nigel Roles
2005-05-09 14:03           ` Charles Forsyth [this message]
2005-05-10 17:09         ` boyd, rounin
2005-05-10 17:15           ` jmk
2005-05-10 18:34             ` boyd, rounin
2005-05-10 18:39               ` rog
2005-05-10 19:27               ` Ronald G. Minnich
2005-05-10 21:02                 ` David Leimbach
2005-05-10 21:20                   ` Bruce Ellis

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=c2e8cb507a9a11e9e25caab353d1c6f6@terzarima.net \
    --to=forsyth@terzarima.net \
    --cc=9fans@cse.psu.edu \
    /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;
as well as URLs for NNTP newsgroup(s).