lua-users home
lua-l archive

Re: [ANN] Lua 5.3.6 (rc1) now available

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


> Roberto> I guess you are talking about this macro:
> 
> Roberto> #define checkstackp(L,n,p) \
> Roberto> luaD_checkstackaux(L, n, \
> Roberto> ptrdiff_t t__ = savestack(L, p); /* save 'p' */ \
> Roberto> luaC_checkGC(L), /* stack grow uses memory */ \
> Roberto> p = restorestack(L, t__)) /* 'pos' part: restore 'p' */
> 
> Roberto> What separates the macro arguments is the comma, not the
> Roberto> semicolon. So, the call to luaC_checkGC is done before the
> Roberto> stack reallocation.
> 
> Aha. Yes, that explains it.
We cannot put the 'pre' code inside braces because of the scope of 't__'.
I think that's what got me when I wrote the macro checkstackGC :-)
-- Roberto

AltStyle によって変換されたページ (->オリジナル) /