home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / lang / cplus / 18642 < prev    next >
Encoding:
Text File  |  1993-01-02  |  2.2 KB  |  56 lines

  1. Newsgroups: comp.lang.c++
  2. Path: sparky!uunet!munnari.oz.au!metro!extro.ucc.su.OZ.AU!maxtal
  3. From: maxtal@extro.ucc.su.OZ.AU (John MAX Skaller)
  4. Subject: Re: BORLAND C++ ; new int(1,000,000)
  5. Message-ID: <1993Jan3.025214.10446@ucc.su.OZ.AU>
  6. Sender: news@ucc.su.OZ.AU
  7. Nntp-Posting-Host: extro.ucc.su.oz.au
  8. Organization: MAXTAL P/L C/- University Computing Centre, Sydney
  9. References: <C01upJ.FAx@fig.citib.com> <1992Dec31.185128.23173@ulysses.att.com> <9300302.976@mulga.cs.mu.OZ.AU>
  10. Date: Sun, 3 Jan 1993 02:52:14 GMT
  11. Lines: 43
  12.  
  13. In article <9300302.976@mulga.cs.mu.OZ.AU> fjh@munta.cs.mu.OZ.AU (Fergus James HENDERSON) writes:
  14. >mwb@ulysses.att.com (Michael W. Balk) writes:
  15. >
  16. >>ghica@fig.citib.com (Renato Ghica) writes:
  17. >>> 
  18. >>> Is it possible to allocate more than 640K (from extended or
  19. >>> expanded memory) on a DOS 5.0 system using a borland 3.1 C++ program?
  20. >>> 
  21. >>> Using the huge memory model, I'm trying to do the equivalent of 
  22. >>>     new int(1,000,000);  
  23. >>> I have not successed. (I know I can allocate 64k+ at the time).
  24. >
  25. >new int(1000000) is *dynamic* allocation, so the limitations on *static*
  26. >data don't apply. It is possible to allocate objects >64k, I think, but
  27. >not >640k. (Get a _real_ operating system, like Linux, not this horrible
  28. >MSDOS :-)
  29. >
  30.     int * x = new int[1000000];
  31.  
  32. will not work. Neither will
  33.  
  34.     int* x = new int[36000]; // >64K
  35.  
  36. because operator new takes an argument of type size_t which is only
  37. 16 bits ( at least in the large model ).
  38.  
  39.     The restrictions on MS-DOS are those of the 8086 processor.
  40. There is NO 640K limit, the limit is 1Meg. (I know, I had 
  41. a machine with 720K RAM available to MS-DOS). Actually, under
  42. DOS-5 for the 386, the limit is 1Meg + 64K due to a quirk of
  43. the 386 processor in real mode.
  44.  
  45.     I am yet to be convinced Unix is a particularly good
  46. operating system either. Its principal advantages are exactly
  47. those of MS-DOS: wide availability of software and familiarity.
  48.  
  49.     Maybe Plan-9 will be better :-)
  50.  
  51. -- 
  52. ;----------------------------------------------------------------------
  53.         JOHN (MAX) SKALLER,         maxtal@extro.ucc.su.oz.au
  54.     Maxtal Pty Ltd, 6 MacKay St ASHFIELD, NSW 2131, AUSTRALIA
  55. ;--------------- SCIENTIFIC AND ENGINEERING SOFTWARE ------------------
  56.