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