summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2020-08-03 16:05:10 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2020-08-03 16:05:10 -0300
commit68109afcdb59a7eeb75bacf055abce3e56a53645 (patch)
tree5fee3fd7c57df2d58972b5d19a364d841c8babd9
parent9cf3299fafa41718e3cb260cc94d1d29bba6335b (diff)
downloadlua-github-68109afcdb59a7eeb75bacf055abce3e56a53645.tar.gz
Detail (in asserts)
Macro 'checkconsistency' replaced by the similar 'checkliveness".
-rw-r--r--lgc.c5
-rw-r--r--lobject.h3
2 files changed, 3 insertions, 5 deletions
diff --git a/lgc.c b/lgc.c
index 717f80e8..cb820f9c 100644
--- a/lgc.c
+++ b/lgc.c
@@ -80,16 +80,13 @@
#define keyiswhite(n) (keyiscollectable(n) && iswhite(gckey(n)))
-#define checkconsistency(obj) \
- lua_longassert(!iscollectable(obj) || righttt(obj))
-
/*
** Protected access to objects in values
*/
#define gcvalueN(o) (iscollectable(o) ? gcvalue(o) : NULL)
-#define markvalue(g,o) { checkconsistency(o); \
+#define markvalue(g,o) { checkliveness(g->mainthread,o); \
if (valiswhite(o)) reallymarkobject(g,gcvalue(o)); }
#define markkey(g, n) { if keyiswhite(n) reallymarkobject(g,gckey(n)); }
diff --git a/lobject.h b/lobject.h
index 04a81d3d..16202230 100644
--- a/lobject.h
+++ b/lobject.h
@@ -96,7 +96,8 @@ typedef struct TValue {
/*
** Any value being manipulated by the program either is non
** collectable, or the collectable object has the right tag
-** and it is not dead.
+** and it is not dead. The option 'L == NULL' allows other
+** macros using this one to be used where L is not available.
*/
#define checkliveness(L,obj) \
((void)L, lua_longassert(!iscollectable(obj) || \