home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!mcsun!sun4nl!and!jos
- From: jos@and.nl (Jos Horsmeier)
- Newsgroups: comp.lang.c
- Subject: Re: HALLOC and HUGE ptrs in Microsoft C
- Message-ID: <4394@dozo.and.nl>
- Date: 23 Jan 93 13:19:30 GMT
- References: <1993Jan21.175608.4279@arizona.edu> <1993Jan22.144653.24939@klaava.Helsinki.FI>
- Distribution: world,local
- Organization: AND Software BV Rotterdam
- Lines: 47
-
- In article <1993Jan22.144653.24939@klaava.Helsinki.FI> wirzeniu@klaava.Helsinki.FI (Lars Wirzenius) writes:
- |jjr@ace.ece.arizona.edu (Jeffrey J. Rodriguez) writes, about using
- |arrays larger than 64 kB under MS-DOS (notoriously an awkward
- |problem):
- |
- |>This sure seems cumbersome. It also seems that a program written for
- |>PC-DOS using halloc and huge ptrs would not run on a Sun running
- |>UNIX. So much for portable C.
-
- |Quite. The approaches I have followed are (more or less in the order
- |of preference):
- |
- |a) forget about DOS machines and write the code under Unix
- |b) use a compiler under DOS that doesn't require halloc or other
- | monstrosities for >64 kB arrays (djgpp is my choice)
- |c) don't use >64 kB arrays
- |
- |I avoid halloc and huge pointers and other compiler-specific methods
- |like the plague they are. Not only are they non-portable, they would
- |require me to learn and understand them first (lazy, ain't I?), and to
- |have to rely on the compiler to get things right while I'm not very
- |certain that I have understood things correctly.
-
- I agree with you wholeheartedly, of course, but don't forget that a PC
- is a very small machine, compared to others. Its processor (Intel 80x86)
- is a very, very funny hodge podge of micro cooking utensils. If a full
- blown pointer is used (say: p), a simple operation like: `p++' causes
- a lot more machine instructions when defined as a `huge' pointer than
- if it were defined as it should have been defined: no `huge' or `far'
- or `humongous' prefixes whatsoever. IMHO, at Intel they don't know
- how to build nice processors, they _do_ know how to squeeze millions
- and millions of gates on a square inch of silicon and they're even
- proud of it. To paraphrase John Cleese: `It's a waste of space.'
-
- I've seen the following lines once in a signature file, and I think
- I like them a lot:
-
- Our sun is not the only star in the universe.
- Our planet is not the only planet rotating around a star, in the universe.
- Our planet is not the only planet with an `intelligent' life form on it.
- Our planet _is_ the only planet in the universe, where they use MSDOS.
-
- kind regards,
-
- Jos aka jos@and.nl
-
- ps. ;-)
-