delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/12/29/12:22:35

Message-Id: <199712291719.TAA01514@ankara.duzen.com.tr>
Comments: Authenticated sender is <mitch AT ankara DOT duzen DOT com DOT tr>
From: "S. M. Halloran" <mitch AT duzen DOT com DOT tr>
Organization: User RFC 822- and 1123-Compliant
To: NonReal <nonreal AT geocities DOT com>
Date: Mon, 29 Dec 1997 19:20:34 +0200
MIME-Version: 1.0
Subject: Re: "big" arrays and the stack
CC: djgpp AT delorie DOT com
In-reply-to: <34A7C2FF.390A@geocities.com>

On 29 Dec 97, NonReal was found to have commented thusly:

> > i have no idea what you mean here, but the difference is whether the
> > array is global or allocated on the stack. the default stack size for
> > djgpp programs is 256Kb, so a local array larger than that will corrupt
> > the stack, leading to a crash. you can either increase the size of the
> > stack, or, better IMO, allocate such a large amount of memory
> > dynamically.
> 
> How do you change the stack size?  I've got a nasty recursive program
> that would love more space to work in :)
> 
> *wave*
> -Tim

The quoted text section below is taken right out of the info text for 
the djgpp/gcc C library reference, courtesy of the rhIDE interface.

<begin quoted text>

Syntax
------

     extern int _stklen;

Description
-----------

This variable sets the minimum stack length that the program requires.
Note that the stack may be much larger than this.  This value should
be set statically, as it is only used at startup.

Example
-------

     int _stklen = 256000;

<end quoted text>

This is also pretty much the case for informing Borland's compiler
what kind of stack you want, and I suspect is also true of the rest 
(Microsoft, Watcom, etc.).

Best regards,


Mitch Halloran
Research (Bio)chemist
Duzen Laboratories Group
Ankara   TURKEY
mitch AT duzen DOT com DOT tr

other job title:  Sequoia's (dob 12-20-95) daddy

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019