From ea968de6f8001b4663c411e445916c3308aabbf8 Mon Sep 17 00:00:00 2001 From: Johny Mattsson Date: Thu, 16 Sep 2021 17:45:04 +1000 Subject: [PATCH] Fixup LROT_MASKs for all modules. Search-and-replace considered harmful. I completely missed the need to explicitly declare "fast" tag functions (__xyz) in the mask field to LROT_BEGIN()/LROT_END() when I brought over the 5.1+5.3 support. Without those flags set properly, the LVM doesn't even bother going looking for those methods, which in this case led to garbage collection not calling the __gc functions, among other horrible things. Mea culpa. --- components/lua/lua-5.1/lnodemcu.h | 8 +++++--- components/modules/crypto.c | 4 ++-- components/modules/file.c | 4 ++-- components/modules/http.c | 4 ++-- components/modules/ledc.c | 4 ++-- components/modules/mqtt.c | 4 ++-- components/modules/net.c | 12 ++++++------ components/modules/pulsecnt.c | 4 ++-- components/modules/sdmmc.c | 4 ++-- components/modules/spi_master.c | 8 ++++---- components/modules/tmr.c | 4 ++-- components/modules/touch.c | 4 ++-- components/modules/u8g2.c | 6 +++--- components/modules/ucg.c | 4 ++-- components/modules/ws2812.c | 4 ++-- 15 files changed, 40 insertions(+), 38 deletions(-) mode change 100755 => 100644 components/modules/tmr.c diff --git a/components/lua/lua-5.1/lnodemcu.h b/components/lua/lua-5.1/lnodemcu.h index e9e2ee1a..36de5602 100644 --- a/components/lua/lua-5.1/lnodemcu.h +++ b/components/lua/lua-5.1/lnodemcu.h @@ -45,9 +45,11 @@ static ROTable_entry LOCK_IN_SECTION(s) rt ## _entries[] = { #define LROT_END(rt,mt,f) {NULL, LRO_NILVAL} }; \ const ROTable rt ## _ROTable = { \ - (GCObject *)1, LUA_TROTABLE, LROT_MARKED, \ - cast(lu_byte, ~(f)), (sizeof(rt ## _entries)/sizeof(ROTable_entry)) - 1, \ - cast(Table *, mt), cast(ROTable_entry *, rt ## _entries) }; + .next = (GCObject *)1, .tt = LUA_TROTABLE, .marked = LROT_MARKED, \ + .flags = cast(lu_byte, ~(f)), \ + .lsizenode = (sizeof(rt ## _entries)/sizeof(ROTable_entry)) - 1, \ + .metatable = cast(Table *, mt), \ + .entry = cast(ROTable_entry *, rt ## _entries) }; #define LROT_BREAK(rt) }; #define LROT_MASK(m) cast(lu_byte, 1<