Whose code should we break? ( was Re: 64 bit C )
Michael Meissner
meissner at osf.org
Fri Feb 22 03:40:46 AEST 1991
In article <1991Feb20.205545.23958 at ux1.cso.uiuc.edu>
phil at ux1.cso.uiuc.edu (Phil Howard KA9WGN) writes:
| gwyn at smoke.brl.mil (Doug Gwyn) writes:
|
| >In article <65469 at brunix.UUCP> cgy at 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 at 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?
More information about the Comp.lang.c
mailing list