home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / lang / c / 20113 < prev    next >
Encoding:
Internet Message Format  |  1993-01-23  |  2.5 KB

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