Mail Archives: djgpp/2003/02/09/12:27:21
> with 16-bit DOS compilers, char buffer[30000][81] seems unrealistic and
> infeasible. Now with Djgpp, how do I allocate such a big buffer in terms of
> what syntax is used? or leave that code snippet intact and the linker will
> function okay?
Yeah, that syntax "just works" with djgpp. Note, however, that there
is still a limit to stack space, so if you try to create a buffer like
that as a local variable (i.e. inside a function) you'll have
problems. If you need a local-scope variable, at least make it
static, or use malloc/free.
ok:
char buffer[30000][81];
int foo()
{
static char buffer[30000][81];
char **buffer2 = malloc(30000 * 81);
}
bad:
int foo()
{
char buffer[30000][81];
}
If needed, however, you can use djgpp's stubedit to increase the size
of the stack to 3mb or more for that particular buffer.
- Raw text -