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.)
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user