pointer representation (was: Re: effect of free())

Richard O'Keefe ok at cs.mu.oz.au
Sun Sep 10 16:47:49 AEST 1989


In article <11016 at smoke.BRL.MIL>, gwyn at smoke.BRL.MIL (Doug Gwyn) writes:
: In article <2064 at munnari.oz.au> ok at cs.mu.oz.au (Richard O'Keefe) writes:
: >If that is so, then a C compiler which exploits x == y to use y where x
: >was written is _not_ guaranteed to preserve things like a ring number,
: >which could be Bad News for people trying to write operating system
: >kernels in C.
: 
: If they're trying to represent (address+ring) as a C pointer, they're
: ALREADY in trouble!

I don't quite follow this.  On the PR1ME 50 series -- and some others --
the native "address" format *always* has a ring number in it.  It's not
a question of someone implementing C on such a machine _choosing_ to
represent address+ring as a C pointer, it's a question of them choosing
to represent C pointers as native hardware-type addresses, and those
addresses always have ring numbers in them.  If the C implementors choose
some other representation for C pointers than native hardware-type addresses,
then they're going to get a performance hit whenever there is an & or *.
All the address registers (remember that this thread is about address
registers?) have a ring number field in them.  The PCL (procedure call)
instruction constructs a stack frame where the argument slots are filled
in with addresses which contain ring numbers.  And so it goes.  There are
three C compilers on these machines that I've heard of, is there anyone on
the net who knows how the "pointers that refer to the same object must
compare equal" rule will affect any of them?



More information about the Comp.lang.c mailing list