diff options
Diffstat (limited to 'src/universe.cpp')
-rw-r--r-- | src/universe.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/universe.cpp b/src/universe.cpp index 116c8e3..9ab6019 100644 --- a/src/universe.cpp +++ b/src/universe.cpp | |||
@@ -135,13 +135,13 @@ Universe::Universe() | |||
135 | 135 | ||
136 | // Initialize 'timerLinda'; a common Linda object shared by all states | 136 | // Initialize 'timerLinda'; a common Linda object shared by all states |
137 | lua_pushcfunction(L_, LG_linda); // L_: settings lanes.linda | 137 | lua_pushcfunction(L_, LG_linda); // L_: settings lanes.linda |
138 | std::ignore = luaG_pushstringview(L_, "lanes-timer"); // L_: settings lanes.linda "lanes-timer" | 138 | std::ignore = luaG_pushstring(L_, "lanes-timer"); // L_: settings lanes.linda "lanes-timer" |
139 | lua_pushinteger(L_, 0); // L_: settings lanes.linda "lanes-timer" 0 | 139 | lua_pushinteger(L_, 0); // L_: settings lanes.linda "lanes-timer" 0 |
140 | lua_call(L_, 2, 1); // L_: settings linda | 140 | lua_call(L_, 2, 1); // L_: settings linda |
141 | STACK_CHECK(L_, 1); | 141 | STACK_CHECK(L_, 1); |
142 | 142 | ||
143 | // Proxy userdata contents is only a 'DeepPrelude*' pointer | 143 | // Proxy userdata contents is only a 'DeepPrelude*' pointer |
144 | _U->timerLinda = *lua_tofulluserdata<DeepPrelude*>(L_, -1); | 144 | _U->timerLinda = *luaG_tofulluserdata<DeepPrelude*>(L_, -1); |
145 | // increment refcount so that this linda remains alive as long as the universe exists. | 145 | // increment refcount so that this linda remains alive as long as the universe exists. |
146 | _U->timerLinda->refcount.fetch_add(1, std::memory_order_relaxed); | 146 | _U->timerLinda->refcount.fetch_add(1, std::memory_order_relaxed); |
147 | lua_pop(L_, 1); // L_: settings | 147 | lua_pop(L_, 1); // L_: settings |
@@ -210,7 +210,7 @@ void Universe::initializeAllocatorFunction(lua_State* const L_) | |||
210 | STACK_CHECK(L_, 1); | 210 | STACK_CHECK(L_, 1); |
211 | 211 | ||
212 | std::ignore = luaG_getfield(L_, -1, "internal_allocator"); // L_: settings "libc"|"allocator" | 212 | std::ignore = luaG_getfield(L_, -1, "internal_allocator"); // L_: settings "libc"|"allocator" |
213 | std::string_view const _allocator{ luaG_tostringview(L_, -1) }; | 213 | std::string_view const _allocator{ luaG_tostring(L_, -1) }; |
214 | if (_allocator == "libc") { | 214 | if (_allocator == "libc") { |
215 | internalAllocator = AllocatorDefinition{ libc_lua_Alloc, nullptr }; | 215 | internalAllocator = AllocatorDefinition{ libc_lua_Alloc, nullptr }; |
216 | } else if (provideAllocator == luaG_provide_protected_allocator) { | 216 | } else if (provideAllocator == luaG_provide_protected_allocator) { |
@@ -317,9 +317,9 @@ void Universe::terminateFreeRunningLanes(lua_State* const L_, lua_Duration const | |||
317 | LUAG_FUNC(universe_gc) | 317 | LUAG_FUNC(universe_gc) |
318 | { | 318 | { |
319 | lua_Duration const _shutdown_timeout{ lua_tonumber(L_, lua_upvalueindex(1)) }; | 319 | lua_Duration const _shutdown_timeout{ lua_tonumber(L_, lua_upvalueindex(1)) }; |
320 | std::string_view const _op_string{ luaG_tostringview(L_, lua_upvalueindex(2)) }; | 320 | std::string_view const _op_string{ luaG_tostring(L_, lua_upvalueindex(2)) }; |
321 | STACK_CHECK_START_ABS(L_, 1); | 321 | STACK_CHECK_START_ABS(L_, 1); |
322 | Universe* const _U{ lua_tofulluserdata<Universe>(L_, 1) }; // L_: U | 322 | Universe* const _U{ luaG_tofulluserdata<Universe>(L_, 1) }; // L_: U |
323 | _U->terminateFreeRunningLanes(L_, _shutdown_timeout, which_cancel_op(_op_string)); | 323 | _U->terminateFreeRunningLanes(L_, _shutdown_timeout, which_cancel_op(_op_string)); |
324 | 324 | ||
325 | // invoke the function installed by lanes.finally() | 325 | // invoke the function installed by lanes.finally() |