Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!think.com!paperboy!meissner From: meissner@osf.org (Michael Meissner) Newsgroups: comp.lang.c Subject: Re: Whose code should we break? ( was Re: 64 bit C ) Message-ID: Date: 21 Feb 91 16:40:46 GMT References: <1215@dms.UUCP> <65469@brunix.UUCP> <15256@smoke.brl.mil> <1991Feb20.205545.23958@ux1.cso.uiuc.edu> Sender: news@OSF.ORG Organization: Open Software Foundation Lines: 37 In-reply-to: phil@ux1.cso.uiuc.edu's message of 20 Feb 91 20:55:45 GMT In article <1991Feb20.205545.23958@ux1.cso.uiuc.edu> phil@ux1.cso.uiuc.edu (Phil Howard KA9WGN) writes: | gwyn@smoke.brl.mil (Doug Gwyn) writes: | | >In article <65469@brunix.UUCP> cgy@cs.brown.edu (Curtis Yarvin) writes: | >>But I want sizeof long == sizeof char *. There are quite a few applications | >>in which I find myself writing my own memory manager; I need some type | >>in which I can flick the bits on my pointers, portably. | | >As maintainer of several major pieces of software that did just that, | >I highly DISrecommend the practice. If you can find ANY way to let | >the C implementation handle memory management sufficiently well for | >your actual needs, you are far better off doing so. | | >Clearly bit diddling in pointers in far from portable. | | Maybe. Maybe not. There is one type of data structure in which bit twiddling | will work on every type of pointer I can think of. Only machine types in which | the size of the pointer itself can vary would have a problem and I know of NO | such machine type. Sigh..... On PR1ME machines (the 50 series), word pointers were 32 bits, and byte pointers were 48 bits, and COULD NOT fit in an integer or long. On the Data General MV computers, word pointers were 32 bits, as were character pointers, but the format of the two were not the same. In particular, the word pointer format was the byte pointer shifted right 1 bit position. The DG MV also had two types of bit pointers, but these were not in general supported by the compiler. -- Michael Meissner email: meissner@osf.org phone: 617-621-8861 Open Software Foundation, 11 Cambridge Center, Cambridge, MA, 02142 Considering the flames and intolerance, shouldn't USENET be spelled ABUSENET?