1Tcl_SetRecursionLimit(3)    Tcl Library Procedures    Tcl_SetRecursionLimit(3)
2
3
4
5______________________________________________________________________________
6

NAME

8       Tcl_SetRecursionLimit  -  set maximum allowable nesting depth in inter‐
9       preter
10

SYNOPSIS

12       #include <tcl.h>
13
14       int
15       Tcl_SetRecursionLimit(interp, depth)
16

ARGUMENTS

18       Tcl_Interp *interp (in)          Interpreter whose recursion  limit  is
19                                        to be set.  Must be greater than zero.
20
21       int depth (in)                   New limit for nested calls to Tcl_Eval
22                                        for interp.
23______________________________________________________________________________
24
25

DESCRIPTION

27       At any given time Tcl enforces a limit on the number of recursive calls
28       that  may  be  active  for  Tcl_Eval  and  related  procedures  such as
29       Tcl_GlobalEval.  Any call  to  Tcl_Eval  that  exceeds  this  depth  is
30       aborted with an error.  By default the recursion limit is 1000.
31
32       Tcl_SetRecursionLimit may be used to change the maximum allowable nest‐
33       ing depth for an interpreter.  The depth argument specifies a new limit
34       for  interp,  and Tcl_SetRecursionLimit returns the old limit.  To read
35       out the old limit without modifying  it,  invoke  Tcl_SetRecursionLimit
36       with depth equal to 0.
37
38       The Tcl_SetRecursionLimit only sets the size of the Tcl call stack:  it
39       cannot by itself prevent stack overflows on the C stack being  used  by
40       the  application.   If  your  machine  has a limit on the size of the C
41       stack, you may get stack overflows before reaching  the  limit  set  by
42       Tcl_SetRecursionLimit.  If this happens, see if there is a mechanism in
43       your system for increasing the maximum size of the C stack.
44
45

KEYWORDS

47       nesting depth, recursion
48
49
50
51Tcl                                   7.0             Tcl_SetRecursionLimit(3)
Impressum