Xref: utzoo comp.lang.c:7383 comp.arch:3468 Path: utzoo!mnetor!uunet!husc6!purdue!umd5!trantor.umd.edu!chris From: chris@trantor.umd.edu (Chris Torek) Newsgroups: comp.lang.c,comp.arch Subject: data alignment (was Re: RISC data alignment, in comp.arch) Message-ID: <2309@umd5.umd.edu> Date: 17 Feb 88 15:41:40 GMT References: <2635@calmasd.GE.COM> <28200092@ccvaxa> <496@ecrcvax.UUCP> Sender: ris@umd5.umd.edu Reply-To: chris@trantor.umd.edu (Chris Torek) Followup-To: comp.lang.c Organization: University of Maryland, College Park Lines: 23 >In article <28200092@ccvaxa> aglew@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@ecrcvax.UUCP> johng@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@mimsy.umd.edu Path: not easily reachable