Re: [DEV-C++] BUG: Dev-C 4.9.20 consolprogram has only access to 1MB memory.
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: staale <st...@le...> - 2002-05-13 06:01:09
|
Well, I'll hold my horses a bit longer before I cry wolf, wolf the next time.:o) As Ioannis has pointed out the different results are differences in the implementation of the mingw32 compiler. Evolving from allowing ca 31MB stack space to ca 2MB. Probably to prevent us from cheating? The following code shows that you have access to all the memory your OS will give you *S*. ------------ Code snip ------------------- // This code consumes memmory on the heap (free storage) // *********************************** // Se also Bruce Eckel 's book Thinking in C++ // page 565 - Running out of storage. // pdf Available at www.BruceEckel.com // *********************************** #include <iostream> int count = 0; int main() { while(true) { count++; // Analyse mem usage with // task manager (NT) or ps, KPM (Linux) int* foo = new int[1024]; // allocate ca 1kB on heap (free storage) if (foo == 0) break; // New return 0 if out of mem (I think!) cout << count << endl; } cout << "new could not allocate more memmory\b" << endl; return 0; } -----------Code end --------------------- Best regards Staale Flock ----- Original Message ----- From: "Ioannis Vranos" <no...@ho...> To: "Dev-C++ Mailing List" <dev...@li...> Sent: Friday, May 10, 2002 6:13 PM Subject: RE: [DEV-C++] BUG: Dev-C 4.9.20 consolprogram has only access to 1MB memory. > > -----Original Message----- > > From: dev...@li... > > [mailto:dev...@li...] On Behalf Of staale > > Sent: Friday, May 10, 2002 12:12 PM > > To: Dev-C++ Mailing List > > Subject: Re: [DEV-C++] BUG: Dev-C 4.9.20 consolprogram has > > only access to 1MB memory. > > > > > > Ioannis and Helmut, > > > > Out of curiosity I tried Ioannis's code in VC6++ SP4 > > (w2k-machine) , and > > KDeveloper 2.0 (RedHat 7.2 - gcc 2.95.x ? ) and the results are: > > VC6++ 936 kB > > KDeveloper 8064 kB > > > > For fun I tried it in VB and Powerbasic to: > > VB6 4382 kB > > PB 4309 kB > > Basic? How did you run C++ code in BASIC (except if you mean you wrote > equivallent recursive BASIC code). > > > > > > I'm still puzzeled by the big difference between the two > > Dev-C releases. The > > only logical explenation is that it is posible to configure > > this somewhere. > > > Yes, it is done inside MINGW's source code. :P > > > > Ioannis > > * Ioannis Vranos > * Programming pages: http://www.noicys.cjb.net > * Alternative URL: http://run.to/noicys > > _______________________________________________________________ > > Have big pipes? SourceForge.net is looking for download mirrors. We supply > the hardware. You get the recognition. Email Us: ban...@so... > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > |