data alignment (was Re: RISC data alignment, in comp.arch)

Chris Torek chris at trantor.umd.edu
Thu Feb 18 01:41:40 AEST 1988


>In article <28200092 at ccvaxa> aglew at ccvaxa.UUCP writes:
>>I have often wanted an optimizing compiler that could [rearrange]
>>struct { long a; int b; long c; char d; }
>>... and make it into AAAACCCCBBDx.

In article <496 at ecrcvax.UUCP> johng at ecrcvax.UUCP (John Gregor) writes:
>I would like that also, but don't call it a struct.  Rearranging the order
>breaks lots of code and violates K&R p. 196.

Yes.  In fact, I have the perfect name for it, stolen from Craig
Stanfill's thesis hacking days here at U of MD.

If you take a bunch of data items and arrange them in an order,
you have a structured collection of data: a `struct'.  But if
you throw the data items in a carry-sack and shake well, you
have an unordered tangle of data.  Hence the proper name for
an unordered aggregate type: a `bag'.

Next week: the `blender' datatype :-) .
-- 
In-Real-Life: Chris Torek, Univ of MD Computer Science, +1 301 454 7163
(hiding out on trantor.umd.edu until mimsy is reassembled in its new home)
Domain: chris at mimsy.umd.edu		Path: not easily reachable



More information about the Comp.lang.c mailing list