Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site pur-phy.UUCP Path: utzoo!linus!decvax!microsoft!uw-beaver!cornell!vax135!ariel!houti!hogpc!houxm!ihnp4!ixn5c!inuxc!pur-ee!CSvax:Pucc-H:pur-phy!suitti From: suitti@CSvax:Pucc-H:pur-phy.UUCP Newsgroups: net.lang.c Subject: Re: Holes in Structures Message-ID: <918@pur-phy.UUCP> Date: Mon, 12-Sep-83 11:31:02 EDT Article-I.D.: pur-phy.918 Posted: Mon Sep 12 11:31:02 1983 Date-Received: Wed, 14-Sep-83 23:39:59 EDT References: <1813@allegra.UUCP> Organization: Purdue Univ. Physics Dept., W. Lafayette, IN Lines: 30 alan@allegra says: Stephen Uitti suggests hacking the C compiler to sort fields within a structure so that there are no holes. Then structure comparison (yes, another hack to the compiler) would work correctly. my reply: This discussion started with structure comparisons. I'm more interested in data space savings. I work with a pdp-11/44. It has split instruction & data. With autmomatic overlays, text space is not usually a problem. 64k data space is ALWAYS a problem. Saving a little space in s structure won't anything, unless it happens to be an array of structures. In this case, a pessimistic order (specified by the programmer) could be significant. I suppose the programmer could "know", and just re-arrange. C does very little optimizing. The philosophy is "let the programmer do that". C allows one to write code that can compile efficiently, but does not enforce efficiency. This philosophy is good for writting a kernel. But I often get code written on VAXen, etc, optimized (if at all) for differant machines. Sometimes, the mechanism I want is not available (efficient float handling, array handling). I'm not one to use the "newest" features. These should be tried & evaluated at length before distribution. An example of this is "enums". They are so un-powerful as to be useless. Most people I know use #define's instead. But, I would start using floats (instead of doubles) if they could be made twice as fast (instead of slower) (as they should be). Stephen Uitti (physics site manager) ...pur-ee!Physics:suitti ...purdue!Physics:suitti