home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / os / msdos / programm / 10385 < prev    next >
Encoding:
Text File  |  1992-11-07  |  2.0 KB  |  43 lines

  1. Xref: sparky comp.os.msdos.programmer:10385 comp.msdos.programmer:85 comp.os.ms-windows.programmer.tools:1352
  2. Newsgroups: comp.os.msdos.programmer,comp.msdos.programmer,comp.os.ms-windows.programmer.tools
  3. Path: sparky!uunet!rei2!fox
  4. From: fox@rei.com (Fuzzy Fox)
  5. Subject: Re: BC++ far* default in medium model
  6. Message-ID: <1992Nov6.171236.1394@rei.com>
  7. Date: Fri, 6 Nov 1992 17:12:36 GMT
  8. References: <1992Nov4.090359.21666@hellgate.utah.edu> <1992Nov5.031544.5264@sequent.com> <1992Nov5.053551.20533@emr1.emr.ca> <1992Nov5.084656.10427@sequent.com>
  9. Organization: Recognition Equipment, Inc.
  10. Lines: 31
  11.  
  12. >>>In your data declarations, if you do not specifically specify the
  13. >>>keyword far, then the declaration is left in the default data
  14. >>>segment, which can be a problem if you have more than 64k of global
  15. >>>data.
  16.  
  17. This is true except in BC++ 3.1, where an option can be set which forces
  18. all data declarations larger than a certain threshold to be
  19. automatically moved into another segment.  The option is -Ff=nnnn, I
  20. believe.  I use -Ff=1024 in all my programs.  In the IDE, this option is
  21. set as the "Automatic Far Data" option and threshold.
  22.  
  23. >If you want to have arrays or structures that explicity
  24. >store > 64k of data in one instance then you have to use the HUGE
  25. >model,
  26.  
  27. You do not have to use huge model, you just need to use the 'huge'
  28. keyword when declaring the data item.  In fact, a common misconception
  29. is that the Huge model forces all pointers to be huge by default.  This
  30. is not true.  Huge model is just like Large model, except that each
  31. individual source file gets its own data segment automatically.  A
  32. single source file program will compile exactly the same under Huge and
  33. Large models.
  34.  
  35. Huge pointers are frought with problems, and you need to know what
  36. you're doing in order to use them properly.
  37.  
  38. -- 
  39. #ifdef TRUE        | Fuzzy Fox (a.k.a. David DeSimone)       fuzzy@netcom.com
  40. #define  TRUE   0  |
  41. #define  FALSE  1  |     "History doesn't repeat itself, but it rhymes."
  42. #endif             |                                   -- Mark Twain
  43.