diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2020-08-03 16:05:10 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2020-08-03 16:05:10 -0300 |
commit | 68109afcdb59a7eeb75bacf055abce3e56a53645 (patch) | |
tree | 5fee3fd7c57df2d58972b5d19a364d841c8babd9 | |
parent | 9cf3299fafa41718e3cb260cc94d1d29bba6335b (diff) | |
download | lua-68109afcdb59a7eeb75bacf055abce3e56a53645.tar.gz lua-68109afcdb59a7eeb75bacf055abce3e56a53645.tar.bz2 lua-68109afcdb59a7eeb75bacf055abce3e56a53645.zip |
Detail (in asserts)
Macro 'checkconsistency' replaced by the similar 'checkliveness".
-rw-r--r-- | lgc.c | 5 | ||||
-rw-r--r-- | lobject.h | 3 |
2 files changed, 3 insertions, 5 deletions
@@ -80,16 +80,13 @@ | |||
80 | #define keyiswhite(n) (keyiscollectable(n) && iswhite(gckey(n))) | 80 | #define keyiswhite(n) (keyiscollectable(n) && iswhite(gckey(n))) |
81 | 81 | ||
82 | 82 | ||
83 | #define checkconsistency(obj) \ | ||
84 | lua_longassert(!iscollectable(obj) || righttt(obj)) | ||
85 | |||
86 | /* | 83 | /* |
87 | ** Protected access to objects in values | 84 | ** Protected access to objects in values |
88 | */ | 85 | */ |
89 | #define gcvalueN(o) (iscollectable(o) ? gcvalue(o) : NULL) | 86 | #define gcvalueN(o) (iscollectable(o) ? gcvalue(o) : NULL) |
90 | 87 | ||
91 | 88 | ||
92 | #define markvalue(g,o) { checkconsistency(o); \ | 89 | #define markvalue(g,o) { checkliveness(g->mainthread,o); \ |
93 | if (valiswhite(o)) reallymarkobject(g,gcvalue(o)); } | 90 | if (valiswhite(o)) reallymarkobject(g,gcvalue(o)); } |
94 | 91 | ||
95 | #define markkey(g, n) { if keyiswhite(n) reallymarkobject(g,gckey(n)); } | 92 | #define markkey(g, n) { if keyiswhite(n) reallymarkobject(g,gckey(n)); } |
@@ -96,7 +96,8 @@ typedef struct TValue { | |||
96 | /* | 96 | /* |
97 | ** Any value being manipulated by the program either is non | 97 | ** Any value being manipulated by the program either is non |
98 | ** collectable, or the collectable object has the right tag | 98 | ** collectable, or the collectable object has the right tag |
99 | ** and it is not dead. | 99 | ** and it is not dead. The option 'L == NULL' allows other |
100 | ** macros using this one to be used where L is not available. | ||
100 | */ | 101 | */ |
101 | #define checkliveness(L,obj) \ | 102 | #define checkliveness(L,obj) \ |
102 | ((void)L, lua_longassert(!iscollectable(obj) || \ | 103 | ((void)L, lua_longassert(!iscollectable(obj) || \ |