🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.os.msdos.programmer
4 messages
4 total messages Started by Steve Summit Fri, 27 Oct 2000 04:17
setting stack size under BC4.5
#8068
Author: Steve Summit
Date: Fri, 27 Oct 2000 04:17
11 lines
1408 bytes
This ought to be an easy question, but I'm drawing a blank
digging through the documentation.  What's the right way to
set a non-default (i.e. bigger, to avoid overflows) stack size
under BC++ 4.5?  I'm building a 16-bit app, using bcc and tlink
(that is, using makefiles and command lines, not the IDE).

					Steve Summit
					scs@eskimo.com
-- 
Programming Challenge #6: Don't just fix the bug.
See http://www.eskimo.com/~scs/challenge/.
Re: setting stack size under BC4.5
#8069
Author: Joe Hagen
Date: Fri, 27 Oct 2000 04:34
15 lines
1474 bytes
Steve,

In your main module put the following line
at file scope:

   extern unsigned _stklen=xxxx;

Joe
jdhagen@chorus.net

----- Original Message -----
From: "Steve Summit" <scs@eskimo.com>
Newsgroups: comp.os.msdos.programmer,borland.public.cpp.borlandcpp
Sent: Thursday, October 26, 2000 11:17 PM
Subject: setting stack size under BC4.5
Re: setting stack size under BC4.5
#8070
Author: Steve Summit
Date: Fri, 27 Oct 2000 21:58
33 lines
2415 bytes
In article <8tb0mj$j4s$1@news.chorus.net>, Joe Hagen
<jdhagen@chorus.net> writes:
>[I had written:]
>> This ought to be an easy question, but I'm drawing a blank
>> digging through the documentation.  What's the right way to
>> set a non-default (i.e. bigger, to avoid overflows) stack size
>> under BC++ 4.5?
> 
> In your main module put the following line
> at file scope:
>    extern unsigned _stklen=xxxx;

Thanks.  As a matter of fact, I had tried that, but since I
wasn't sure it was right and it didn't seem to help, I didn't
mention it at first.

There are two possible reasons for a stack overflow, of course.
One is that the stack isn't big enough for the call depth of your
program, and one is that you've got an infinitely recursive call,
that will chew up any stack, no matter how big.  It looks like I
had one of the latter.  (Not in an obvious way, though; it looks
like I picked a name for a new function of mine which matched a
library function of some sort, and the combination of my function
and the library's expectations for its function caused the
infinite recursion.  But changing the name of my function made
the problem go away.)

Also, thirty lashes with a wet noodle to me for neglecting to
check the FAQ list for comp.os.msdos.programmer, which answers
the question I asked, plain as day.

					Steve Summit
					scs@eskimo.com
Re: setting stack size under BC4.5
#8071
Author: me
Date: Fri, 27 Oct 2000 23:44
24 lines
2124 bytes
Steve Summit <scs@eskimo.com> wrote:
> In article <8tb0mj$j4s$1@news.chorus.net>, Joe Hagen
> <jdhagen@chorus.net> writes:
>>[I had written:]
>>> This ought to be an easy question, but I'm drawing a blank
>>> digging through the documentation.  What's the right way to
>>> set a non-default (i.e. bigger, to avoid overflows) stack size
>>> under BC++ 4.5?
>> 
>> In your main module put the following line
>> at file scope:
>>    extern unsigned _stklen=xxxx;

> Thanks.  As a matter of fact, I had tried that, but since I
> wasn't sure it was right and it didn't seem to help, I didn't
> mention it at first.

> There are two possible reasons for a stack overflow, of course.
> One is that the stack isn't big enough for the call depth of your
> program, and one is that you've got an infinitely recursive call,
> that will chew up any stack, no matter how big. 

There's a third (a fake one) and that only happens if you're using 
ISR's.  In that case, you just need to disable stack checking.
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads