gsl-shell.git - gsl-shell

index : gsl-shell.git
gsl-shell
summary refs log tree commit diff
path: root/lua
diff options
context:
space:
mode:
Diffstat (limited to 'lua')
-rw-r--r--lua/src/lgc.c 13
1 files changed, 12 insertions, 1 deletions
diff --git a/lua/src/lgc.c b/lua/src/lgc.c
index d9e0b782..83bbc4c2 100644
--- a/lua/src/lgc.c
+++ b/lua/src/lgc.c
@@ -334,6 +334,17 @@ static size_t propagateall (global_State *g) {
** other objects: if really collected, cannot keep them; for userdata
** being finalized, keep them in keys, but not in values
*/
+#ifdef GSL_SHELL_LUA
+static int iscleared (const TValue *o, int iskey) {
+ (void) iskey;
+ if (!iscollectable(o)) return 0;
+ if (ttisstring(o)) {
+ stringmark(rawtsvalue(o)); /* strings are `values', so are never weak */
+ return 0;
+ }
+ return iswhite(gcvalue(o)) || (ttisuserdata(o) && isfinalized(uvalue(o)));
+}
+#else
static int iscleared (const TValue *o, int iskey) {
if (!iscollectable(o)) return 0;
if (ttisstring(o)) {
@@ -343,7 +354,7 @@ static int iscleared (const TValue *o, int iskey) {
return iswhite(gcvalue(o)) ||
(ttisuserdata(o) && (!iskey && isfinalized(uvalue(o))));
}
-
+#endif
/*
** clear collected entries from weaktables
generated by cgit v1.2.3 (git 2.25.1) at 2025年09月16日 18:07:10 +0000

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