Mail Archives: djgpp/1998/03/13/20:24:26
At 03:02 3/13/1998 GMT, Jeff Williams wrote:
>Hello,
> First off, I have never programmed in protected mode before, so this
>question may seem painfully obvious, but I just can't get it. The
>problem is, in a game I am making, I need to initialize and use a somewhat
>large int array (and it just wont work). The array is supposed to be
>1024x960, but if I initialize an array (after all of the image/sample
>loading into memory) larger than 320x200, the program crashes right away.
>I don't even have to attempt to manipulate it for it to crash, so I assume
>it is a memory problem.
Don't make it an auto array; the stack is usually only 256K and overflowing
it is very bad. Make it global or use `malloc'.
> I tried doing a malloc loop before and after
>loading everything, and for some odd reason, my avail. memory never
>decreased or increased (I ran it before loading images, etc, after loading
>them, and after initializing the 320x200 array... and it always stayed at
>8mb).
How did you determine this? Most ways of determining free memory don't work
very well, for a variety of reasons.
> I am running Win95, and have 24mb of RAM.
Did you set the DPMI memory to 65535? FAQ section 15.6.
Nate Eldredge
eldredge AT ap DOT net
- Raw text -