diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2015-10-21 16:40:47 -0200 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2015-10-21 16:40:47 -0200 |
| commit | 5bdee4f81057698cf7da2bb5da814984170abf8c (patch) | |
| tree | 254f8575ed2b1bc4973887caab35404cc7d0cd44 /llimits.h | |
| parent | 48098c42ff69154811f234c1446b4fcbf2f15e94 (diff) | |
| download | lua-5bdee4f81057698cf7da2bb5da814984170abf8c.tar.gz lua-5bdee4f81057698cf7da2bb5da814984170abf8c.tar.bz2 lua-5bdee4f81057698cf7da2bb5da814984170abf8c.zip | |
small changes to allow 'precall' to spend time preserving 'func'
only when needed (that is, when stack actually changes)
Diffstat (limited to 'llimits.h')
| -rw-r--r-- | llimits.h | 13 |
1 files changed, 7 insertions, 6 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: llimits.h,v 1.138 2015/09/22 14:18:24 roberto Exp roberto $ | 2 | ** $Id: llimits.h,v 1.139 2015/10/06 14:29:49 roberto Exp roberto $ |
| 3 | ** Limits, basic types, and some other 'installation-dependent' definitions | 3 | ** Limits, basic types, and some other 'installation-dependent' definitions |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -306,17 +306,18 @@ typedef unsigned long Instruction; | |||
| 306 | ** macro to control inclusion of some hard tests on stack reallocation | 306 | ** macro to control inclusion of some hard tests on stack reallocation |
| 307 | */ | 307 | */ |
| 308 | #if !defined(HARDSTACKTESTS) | 308 | #if !defined(HARDSTACKTESTS) |
| 309 | #define condmovestack(L) ((void)0) | 309 | #define condmovestack(L,pre,pos) ((void)0) |
| 310 | #else | 310 | #else |
| 311 | /* realloc stack keeping its size */ | 311 | /* realloc stack keeping its size */ |
| 312 | #define condmovestack(L) luaD_reallocstack((L), (L)->stacksize) | 312 | #define condmovestack(L,pre,pos) \ |
| 313 | { int sz_ = (L)->stacksize; pre; luaD_reallocstack((L), sz_); pos; } | ||
| 313 | #endif | 314 | #endif |
| 314 | 315 | ||
| 315 | #if !defined(HARDMEMTESTS) | 316 | #if !defined(HARDMEMTESTS) |
| 316 | #define condchangemem(L) condmovestack(L) | 317 | #define condchangemem(L,pre,pos) ((void)0) |
| 317 | #else | 318 | #else |
| 318 | #define condchangemem(L) \ | 319 | #define condchangemem(L,pre,pos) \ |
| 319 | ((void)(!(G(L)->gcrunning) || (luaC_fullgc(L, 0), 1))) | 320 | { if (G(L)->gcrunning) { pre; luaC_fullgc(L, 0); pos; } } |
| 320 | #endif | 321 | #endif |
| 321 | 322 | ||
| 322 | #endif | 323 | #endif |
