diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2019-06-18 16:52:22 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2019-06-18 16:52:22 -0300 |
| commit | be73f72fcc944a8ebae2c60d2ce84139acb011b9 (patch) | |
| tree | 6ba1154c224a4b7af9e5202b4b52e43706faddb1 /lstate.h | |
| parent | 3cd9b56ae6002b4ef28d2467abd119606ae625d3 (diff) | |
| download | lua-be73f72fcc944a8ebae2c60d2ce84139acb011b9.tar.gz lua-be73f72fcc944a8ebae2c60d2ce84139acb011b9.tar.bz2 lua-be73f72fcc944a8ebae2c60d2ce84139acb011b9.zip | |
New function 'setCstacklimit'
Added new functions to dynamically set the C-stack limit
('lua_setCstacklimit' in the C-API, 'debug.setCstacklimit' in Lua).
Diffstat (limited to 'lstate.h')
| -rw-r--r-- | lstate.h | 5 |
1 files changed, 5 insertions, 0 deletions
| @@ -103,6 +103,10 @@ | |||
| 103 | #define CSTACKERRMARK (CSTACKCF + 2) | 103 | #define CSTACKERRMARK (CSTACKCF + 2) |
| 104 | 104 | ||
| 105 | 105 | ||
| 106 | /* initial limit for the C-stack of threads */ | ||
| 107 | #define CSTACKTHREAD (2 * CSTACKERR) | ||
| 108 | |||
| 109 | |||
| 106 | /* true if this thread does not have non-yieldable calls in the stack */ | 110 | /* true if this thread does not have non-yieldable calls in the stack */ |
| 107 | #define yieldable(L) (((L)->nCcalls & 0xffff0000) == 0) | 111 | #define yieldable(L) (((L)->nCcalls & 0xffff0000) == 0) |
| 108 | 112 | ||
| @@ -267,6 +271,7 @@ typedef struct global_State { | |||
| 267 | TString *strcache[STRCACHE_N][STRCACHE_M]; /* cache for strings in API */ | 271 | TString *strcache[STRCACHE_N][STRCACHE_M]; /* cache for strings in API */ |
| 268 | lua_WarnFunction warnf; /* warning function */ | 272 | lua_WarnFunction warnf; /* warning function */ |
| 269 | void *ud_warn; /* auxiliary data to 'warnf' */ | 273 | void *ud_warn; /* auxiliary data to 'warnf' */ |
| 274 | unsigned int Cstacklimit; /* current limit for the C stack */ | ||
| 270 | } global_State; | 275 | } global_State; |
| 271 | 276 | ||
| 272 | 277 | ||
