[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gcl-devel] GCL stack size

From: Vadim V. Zhytnikov
Subject: Re: [Gcl-devel] GCL stack size
Date: Thu, 28 Aug 2003 09:18:12 +0300
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; ru-RU; rv:1.4) Gecko/20030630

Sorry for not mentioning it - I don't observe any strange things
anymore. Probably it was some bogus result - not clean rebuild
or something like this.  With stacks size changeable by configure
it is much easier to do various stack related tests.

AS for IHS and BDS size I agree that the only reasonable option
is to keep them of the same size (in my patch both are set to 4K).

There is yet one stack related question. In GCL I can enlarge
stacks size at run time by assigning any nonzero positive value to
special variable *multiply-stacks*.  Indeed if I enter

> (setq si::*multiply-stacks* 2)

GCL automatically restarts (TOP-LEVEL) and I have stacks of
doubled size.  Restarting (TOP-LEVEL) is essential.
And the question is - is there any way to do something like this
in Maxima?  I can set (setq si::*multiply-stacks* 2). I can
start (TOP-LEVEL) manually but it has no effect on stacks size.

Camm Maguire writes:
Hi Vadim!  Do you still get this strange result with your propsed
patch, or does that work supercede this note?

Take care,

"Vadim V. Zhytnikov" <address@hidden> writes:

I've been playing with stack size in GCL and got some
strange result. For test purpose I enlarged both IHS and FRS
stack to 8K or 16K items both.  But if I start some infinite
recursion function like one below the executions
stops at 5450 level with "value stack exhausted".
I've tried to enlarge VSSIZE using --enable-vssize=64*1024
but nothing changed - test still stops at 5450.
It's very strange since smaller value --enable-vssize=16*1024
works - execution stops at ~2700.  This is OK since default
value is 32K (not in stacks.h but defined by configure),
so ~2700 is expectable.

Camm Maguire writes:

Hi Vadim!  First, do you feel this is related to my earlier request
for suggestions on our gbc setup?  Or is this a separate concern?
In any case, here is stacks.h with my comments:
#ifndef MAXPAGE  /* total memory */
#define MAXPAGE (32 * 1024)
#ifndef VSSIZE  /* value stack size, configurable, default below */
#define VSSIZE 8192
#define VSGETA 128 /* emergency extra stack space available to a
                       running program */
EXTER object value_stack[VSSIZE + (STACK_OVER +1) *VSGETA];
#define BDSSIZE         1024  /* variable dynamic binding stack
                               globals can have different bindings in
                               nested functions */
#define BDSGETA         40
EXTER struct bds_bd bind_stack[BDSSIZE + (STACK_OVER +1)* BDSGETA];
    /*  #define IHSSIZE         1024 */
/*  #define     IHSGETA         32 */
#define IHSSIZE         4096 /* a stack listing the name and base
                               address of parent function calls */
#define IHSGETA         64
EXTER struct invocation_history ihs_stack[IHSSIZE + (STACK_OVER +1)
* IHSGETA];     #define FRSSIZE         1024 /* a stack
providing debugging
                               information for  function calls in
                               interpreted and possibly compiled
                               code, i.e. addresses for interactively
                               long jumping back to a particular parent call, 
etc. */
#define FRSGETA         16
EXTER struct frame frame_stack[FRSSIZE + (STACK_OVER +1) * FRSGETA];
Suggestions for default values, and/or which should be configurable,
are welcome.  My feeling is that frs and ihs should be the same size.
Take care,
"Vadim V. Zhytnikov" <address@hidden> writes:

It seems to me that current dfault stack size
is too little.  I recall thet it was enlarged
to 1K not so long ago and now if I fire
(defun f (i) (f (print (+ i 1))))
(f 0)
we end with 1021.  But IMHO it is not
that much.  I found out that in
CLISP, SBCL and CMUCL minimal stack
size is much greater - minimal about 14K.
Even ACL demo has 4K stach limit - but
this is intended demo limitation.
Ideally I'd like to see stack size as
GCL configure option.  As far as I
understand stack size is defined in
stack.h but I a bit confused by
multitude of constants in this file.

    Vadim V. Zhytnikov


Gcl-devel mailing list

     Vadim V. Zhytnikov


     Vadim V. Zhytnikov


reply via email to

[Prev in Thread] Current Thread [Next in Thread]