Alignment (was: Structure Member Padding)

Richard Tobin richard at aiai.ed.ac.uk
Thu Aug 9 03:33:39 AEST 1990


>> Chars could, however, in theory be constrained to even MACHINE addresses,
>> although consecutive char* values in C programs would still be required
>> to index consecutive char objects (each of which would, in such a case,
>> occupy two machine storage units).

Indeed, it should be possible to deal with arbitrary machine
constraints by making C's pointers sufficiently unrelated to machine
addresses.  As an extreme, you could have C pointers just be integers,
and have tables (or arbitrarily complicated procedures) to translate
them to and from machine addresses.  This might of course be rather
slow.

There is work being done on a C compiler for the KCM, a machine which
can only address 8-byte objects, only 4 bytes of which contain normal
data (the other four contain among other things a data type tag).
I'll be interested to see what it looks like.

-- Richard
-- 
Richard Tobin,                       JANET: R.Tobin at uk.ac.ed             
AI Applications Institute,           ARPA:  R.Tobin%uk.ac.ed at nsfnet-relay.ac.uk
Edinburgh University.                UUCP:  ...!ukc!ed.ac.uk!R.Tobin



More information about the Comp.std.c mailing list