Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site brl-tgr.ARPA Path: utzoo!watmath!clyde!cbosgd!ihnp4!houxm!vax135!cornell!uw-beaver!tektronix!decvax!genrad!panda!talcott!harvard!seismo!brl-tgr!tgr!cottrell@nbs-vms.ARPA From: cottrell@nbs-vms.ARPA Newsgroups: net.lang.c Subject: sizeof Message-ID: <7999@brl-tgr.ARPA> Date: Mon, 4-Feb-85 17:02:12 EST Article-I.D.: brl-tgr.7999 Posted: Mon Feb 4 17:02:12 1985 Date-Received: Fri, 8-Feb-85 01:57:03 EST Sender: news@brl-tgr.ARPA Organization: Ballistic Research Lab Lines: 45 /* > > Someone also said that ptr's to different objex may be different sizes. > > Where & why? > > Where: > > On a Zilog 8000 running in segmented mode (24-bit pointers). > On a Motorola 68000. > On an Intel 802*8[68] running large-model code. > Just because a machine supports large pointers doesn't mean that it > supports 32-bit arithmetic well. The Z8000 probably does 32-bit > arithmetic 16 bits at a time. The 68000 definitely does, and can't do > 32-bit multiplies or divides conveniently at all. The 68000 only uses 24 bits for addressing, but uses them either 1) as a 32 bit item in the instruxion stream, & 2) in a 32 bit register. While it would be possible for an implementor to use only 3 bytes, the space saved would be offset by the overhead in loading into a four byte register & masking. The 24 bit restrixion is only temporary anyway. Future versions will probably allow 32 bits. I think the SUN mmu axually uses these bits. I think the z8000 has 32 bit regs too. > Why: > > Because it doesn't say anywhere that you can't. Because you may not want > to pay the penalty for 32-bit arithmetic. If you have a machine with an address space > 64k, you probably have 32 bit registers. > > I realize that a certain machine may desire this to make implementation > > as efficient as possible, but I think the designers should just bite > > the bullet and make all ptr's the same size. > > On this point, I agree. 16-bit "int"s make techniques like using "malloc" > and "realloc" to grow a large table (used by such obscure programs as "nm") > lose big. I just read a news item from yourself which stated: "THERE IS NO SUCH THING AS A GENERIC NULL POINTER" Presumably because of different length pointers. Which way do you want it? > > Guy Harris > {seismo,ihnp4,allegra}!rlgvax!guy */