[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-10 01:42:50
|
Se also thread:
[Dev-C++] not enough memory - how to configure Win2000
on the mailing list. Test code below
Hi Helmuth,
Turns out this has somthing to do with Dev-C 4.9.20.
This is what I did to verify the problem:
1: Tried your file on both w2k (Clean system) or NT4-Sp6. It failed on both
machins.
2: I installed DEV-C 4.9.20 (downloaded today) on a clean w2k machine and
encountered the same problem when I compiled and ran the code.
3: Tried to uninstall DEV-C 4.9.20. Uninstal DOES NOT work. Delete the fiels
manualy. Search for dev-c in regedit.exe and then run RegClean.exe just
search for RegClean and you should be well of (Might not nead this see pkt
5)
4: Installed DEV-C 4.0 on the w2k machine Compiled and tested OK to 31MB.
5: Installed Dev-c 4.9.20 on top of the 4.0 and It still worked nicely..:o)
6: Installed Dev-C 4.9.20 on NT4-SP6 (Only Winzip appart from OS). Added
shlwapi.dll and wininet.dll to system32 folder. Tried to run the code but
no. Same failure.
7: Installed Dev-C 4.0 on top of the 4.9.20. This did not help. Brobably
because both installers does not overwrite existing header files (?). So you
should delete the 4.9.x installaation. Install 4.0 and then 4.9.x (if you
nead it. It is a must if you want to use the wxWindows lib, if I understand
right)
I'm not a seasoned C developer but would gues there are somthing wrong with
a header file or reference making dev-c 4.9.x compile to 16bit code(???)
Best regards
Staale Flock
------------------- Code
Start --------------------------------------------------------
////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////
// this code fails if you install Dev-C 4.9.20 on a new w2k machine and try
to access
// more than 1MB memory. (Enter any number higher than 1).
////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{
const long MEGA_BYTE = 1024*1024;
long nMBSize = 1;
while (nMBSize != 0 ){
cout << "Give MB size: ";
cin >> nMBSize;
char narrBig[nMBSize * MEGA_BYTE];
cout << "char size: " << sizeof(char) << " Bytes." << endl;
cout << "Array size: " << sizeof(narrBig)<< " Bytes." << endl;
//See if initializing each element makes a difference
for (unsigned long i = 0; i<nMBSize*MEGA_BYTE;i++){
narrBig[i] = 'A';
}//i
cout << "Array size: " << sizeof(narrBig) << endl;
//If you store objects in the array remember to use:
delete []narrBig;
}//while (nMB..
//To have a breake before window closes, use:
system("PAUSE");
return 0;
}
------------------- Code end ---------------------------------
----- Original Message -----
From: <jar...@be...>
To: <st...@le...>
Sent: Thursday, May 09, 2002 11:48 AM
Subject: Re: [Dev-C++] not enough memory - how to configure Win2000
> On 8 May, staale wrote:
> > I have tried my sample program on a w2k machine now and it work al the
way
> > up to 31 (thats wher you meet the long border is it not)?
> >
> > If you send me your compiled binary, I'll giv it a try. (hmm, could be
> > during thge weekend as I'm sceduled for the next 48 houers.:o) Also if
you
> > search for the drwtsn32.log file. Giv it a new name, delete it or what
ever.
> > Run the test program again. And then include the drwtsn32.log file in
your
> > mail to me. I might be able to help a litle bit more. The drwtsn32.log
is a
> > simpel debug dump file (I think www.sysinternals.com has an articel on
how
> > to read it).
> >
> > A thought, how do you start the program? From the Dev-C IDE or in a
console
> > window? If you use start-run-command.exe I belive you will be runing a
nativ
> > DOS session. You should use start-run-cmd.exe (don't nead the exe part)
to
> > get flat memmory. The last is what you get if you double click the
> > pBigArray.exe from explorer.
>
> Unfortunately, this doesn't help either.
>
> Many thanks for looking into it,
> Helmut.
>
> --
> Helmut Jarausch
>
> Lehrstuhl fuer Numerische Mathematik
> Institute of Technology, RWTH Aachen
> D 52056 Aachen, Germany
>
|