Mail Archives: djgpp/1998/06/06/20:45:34
In comp.os.msdos.djgpp, article <3578C43D DOT F4DDB90 AT cs DOT com>, John M.
Aldrich (fighteer AT cs DOT com) wrote:
> Andrew R. Gillett wrote:
> >
> > struct pixel_struct pixel[AREA_WIDTH][AREA_HEIGHT];
> > AREA_WIDTH = 640, AREA_HEIGHT = 480. I also get this error with 256x200,
> > the lowest mode Allegro can do.
>
> Your problem is stack overflow. If you declare a local object of that
> class, you're allocating all of the memory for the array from the
> stack. Since the default runtime stack for DJGPP programs is 256K,
> you're overflowing it and your program will therefore crash most
> spectacularly.
This structure is 1200K...
> There are two solutions: you can read chapter 15.9 of the DJGPP FAQ to
> learn how to increase the stack size of your programs, or you can take
> the better route and create your object statically or dynamically.
OK, sorry to keep asking questions like this, but:
How do I do that?
Do I have to use malloc or something to give myself a big chunk of
memory? Or is it something else? The trouble is, I consider myself to be
reasonably good at programming, but I don't have all that essential
technical knowledge. Just the stuff they taught me at college, which is
just the basics and nothing else...
- Raw text -