From 60b6599e8322dd93e3b33c9496ff035a1c45552f Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Tue, 15 Jul 2025 14:40:27 -0300 Subject: Short strings can be external, too That complicates a little object equality (and therefore table access for long strings), but the old behavior was somewhat weird. (Short strings, a concept otherwise absent from the manual, could not be external.) --- loadlib.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'loadlib.c') diff --git a/loadlib.c b/loadlib.c index 2cd95ca3..8d2e68e2 100644 --- a/loadlib.c +++ b/loadlib.c @@ -345,8 +345,8 @@ static void *freelib (void *ud, void *ptr, size_t osize, size_t nsize) { ** Create a library string that, when deallocated, will unload 'plib' */ static void createlibstr (lua_State *L, void *plib) { - static const char dummy[] = /* common long body for all library strings */ - "01234567890123456789012345678901234567890123456789"; + /* common content for all library strings */ + static const char dummy[] = "01234567890"; lua_pushexternalstring(L, dummy, sizeof(dummy) - 1, freelib, plib); } -- cgit v1.2.3-55-g6feb