lua

A copy of the Lua development repository
Log | Files | Refs | README

commit 39929384c631ba43c12958a7d7f0e0ec4723241f
parent de7cf8e63abac49100f99e60782575f940252cfd
Author: Roberto Ierusalimschy <roberto@inf.puc-rio.br>
Date:   Fri,  8 Nov 2013 15:35:40 -0200

new macro 'luai_userstateclose' (to test it is being called correctly)

Diffstat:
Mltests.h | 4+++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/ltests.h b/ltests.h @@ -1,5 +1,5 @@ /* -** $Id: ltests.h,v 2.32 2010/04/19 17:40:13 roberto Exp roberto $ +** $Id: ltests.h,v 2.33 2010/07/28 15:51:59 roberto Exp roberto $ ** Internal Header for Debugging of the Lua Implementation ** See Copyright Notice in lua.h */ @@ -61,6 +61,8 @@ struct L_EXTRA { int lock; int *plock; }; #define getlock(l) (cast(struct L_EXTRA *, l) - 1) #define luai_userstateopen(l) \ (getlock(l)->lock = 0, getlock(l)->plock = &(getlock(l)->lock)) +#define luai_userstateclose(l) \ + lua_assert(getlock(l)->lock == 1 && getlock(l)->plock == &(getlock(l)->lock)) #define luai_userstatethread(l,l1) (getlock(l1)->plock = getlock(l)->plock) #define luai_userstatefree(l,l1) \ lua_assert(getlock(l)->plock == getlock(l1)->plock)