Tcl_SetRecursionLimit(3)
β¨ NAME β¨
okay so bestie, welcome to the Tcl Library Procedures page for Tcl_SetRecursionLimit(3) β and it's literally all about setting the maximum allowable nesting depth in an interpreter. No cap. π
Tcl_SetRecursionLimit β set maximum allowable nesting depth in interpreter
π SYNOPSIS π
#include <tcl.h>
Tcl_Size
Tcl_SetRecursionLimit(interp, depth)
πΈ ARGUMENTS πΈ
Tcl_Interp *interp(in) β Interpreter whose recursion limit is to be set. Must be greater than zero. (Yes bestie, that's the rule, keep it in mind.)Tcl_Size depth(in) β New limit for nested calls toTcl_Evalfor interp.
π DESCRIPTION π
At any given time Tcl enforces a limit on the number of recursive calls that may be active for Tcl_Eval and related procedures such as Tcl_EvalEx. Any call to Tcl_Eval that exceeds this depth is aborted with an error. By default the recursion limit is 1000. (So like, if you're going deeper than 1000 nested eval calls, Tcl is gonna shut that down, periodt. π)
Tcl_SetRecursionLimit may be used to change the maximum allowable nesting depth for an interpreter. The depth argument specifies a new limit for interp, and Tcl_SetRecursionLimit returns the old limit. To read out the old limit without modifying it, invoke Tcl_SetRecursionLimit with depth equal to 0. (Sneaky lil read-only mode, iconic. β¨)
The Tcl_SetRecursionLimit only sets the size of the Tcl call stack: it cannot by itself prevent stack overflows on the C stack being used by the application. If your machine has a limit on the size of the C stack, you may get stack overflows before reaching the limit set by Tcl_SetRecursionLimit. If this happens, see if there is a mechanism in your system for increasing the maximum size of the C stack.
β οΈ so like, this function is not a magic C-stack shield, bestie. It only sets the size of the Tcl call stack. If your C stack has a limit, you can still overflow before hitting the Tcl limit. Check your system for a way to increase the max C stack size if that happens. π«Ά
π KEYWORDS π
- nesting depth
- recursion
This page comes from Tcl 7.0, manual page Tcl_SetRecursionLimit(3) β the footer didn't include a date, so that's all she wrote. Byeee π
β¨
π¦ where this page comes from
- alpine 3.23: tcl9-doc 9.0.3-r0 Β· TCL
- alpine 3.24: tcl9-doc 9.0.3-r2 Β· TCL
- fedora 43: tcl-doc 1:9.0.2-1.fc43 Β· TCL AND GPL-3.0-or-later WITH Bison-exception-2.2 AND BSD-3-Clause
- fedora 44: tcl-doc 1:9.0.2-1.fc44 Β· TCL AND GPL-3.0-or-later WITH Bison-exception-2.2 AND BSD-3-Clause
- nixos 26.05: tcl 9.0.3
- nixpkgs unstable: tcl 9.1.0
- Copyright (c) 1989-1993 The Regents of the University of California
- Copyright (c) 1994-1996 Sun Microsystems, Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms