| delorie.com/archives/browse.cgi | search |
| From: | "doug" <deleveld AT dds DOT nl> |
| Newsgroups: | comp.os.msdos.djgpp |
| Subject: | Re: new throwing exception |
| Date: | 26 Dec 1999 01:00:16 GMT |
| Organization: | none |
| Lines: | 28 |
| Message-ID: | <01bf4f3d$72ddc880$d6247d81@doug> |
| References: | <8414d9$32$1 AT nnrp1 DOT deja DOT com> <842qvj$sv$1 AT nnrp1 DOT deja DOT com> |
| NNTP-Posting-Host: | client36-214.oprit.rug.nl |
| X-Trace: | info.service.rug.nl 946170016 22002 129.125.36.214 (26 Dec 1999 01:00:16 GMT) |
| X-Complaints-To: | newsmaster AT rug DOT nl |
| NNTP-Posting-Date: | 26 Dec 1999 01:00:16 GMT |
| X-Newsreader: | Microsoft Internet News 4.70.1155 |
| To: | djgpp AT delorie DOT com |
| DJ-Gateway: | from newsgroup comp.os.msdos.djgpp |
| Reply-To: | djgpp AT delorie DOT com |
cascade AT swipnet DOT se schreef in artikel <842qvj$sv$1 AT nnrp1 DOT deja DOT com>...
<< snip>>
> try {
> foo = new char[1000 000 000];
> foo[999999999] = 'a';
> }
> catch (bad_alloc e) {
> cout << "Gotcha!" << endl;
> }
> }
>
> I get a printout that says "Virtual memory exceeded in 'new'".
What did you expect? What do you need a gigabyte for?
If it fails for smaller allocations like 1 meg then there is a problem,
but there are some limitations about how much mem you can allocate.
This is true of every compiler that I know of, so it is not a problem
with DJGPP.
I have no idea what platform you would need to be able to allocate 1 gig
Doug Eleveld
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |