Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!lll-lcc!styx!ames!necntc!linus!philabs!micomvax!musocs!mcgill-vision!mouse From: mouse@mcgill-vision.UUCP (der Mouse) Newsgroups: comp.arch Subject: Re: bit, byte, and word level addressing Message-ID: <744@mcgill-vision.UUCP> Date: Sun, 26-Apr-87 14:43:35 EDT Article-I.D.: mcgill-v.744 Posted: Sun Apr 26 14:43:35 1987 Date-Received: Sun, 3-May-87 18:39:42 EDT References: <16038@amdcad.AMD.COM> <1239@ames.UUCP> <466@alliant.UUCP> Distribution: world Organization: McGill University, Montreal Lines: 26 Keywords: word alignment, bit level addressing, memory accesses In article <466@alliant.UUCP>, steckel@alliant.UUCP (Geoff Steckel) writes: > C is/was unable to deal with bit arrays because the PDP11 didn't have > bit pointers. I would be very curious to hear how many > programs/programmers would _use_ bit fields & bit arrays on a regular > basis if they were easier to use. I certainly would. I regularly waste 87.5% of the space in some arrays because I need only a boolean but I can't have an array of single bits without great pain, while memory is cheap. Of course, if the difference is a lot of memory, I will go to bit arrays (eg, mark bits for a lisp garbage collector I implemented - need one per datum, datum can be as small as 8 bytes; using one byte to mark eight seemed excessive). > This leads me to formulate a rule: any data type not easily > addressed is a 'second-class datatype' and will be avoided by > programmers. Any agreement or disagreement? Strong agreement. I even find myself avoiding long and short integers because their names are 5 and 6 characters (respectively) longer than simple integers. (Yes, I know this is not a teriffically good practice and will probably bite me someday.) der Mouse (mouse@mcgill-vision.uucp)