diff options
Diffstat (limited to 'src/lanes.cpp')
-rw-r--r-- | src/lanes.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/lanes.cpp b/src/lanes.cpp index 6b3542b..df509ee 100644 --- a/src/lanes.cpp +++ b/src/lanes.cpp | |||
@@ -442,7 +442,7 @@ static bool selfdestruct_remove( Lane* s) | |||
442 | */ | 442 | */ |
443 | static int selfdestruct_gc( lua_State* L) | 443 | static int selfdestruct_gc( lua_State* L) |
444 | { | 444 | { |
445 | Universe* const U{ lua_touserdata<Universe>(L, 1) }; | 445 | Universe* const U{ lua_tofulluserdata<Universe>(L, 1) }; |
446 | 446 | ||
447 | while( U->selfdestruct_first != SELFDESTRUCT_END) // true at most once! | 447 | while( U->selfdestruct_first != SELFDESTRUCT_END) // true at most once! |
448 | { | 448 | { |
@@ -574,7 +574,7 @@ static int selfdestruct_gc( lua_State* L) | |||
574 | { | 574 | { |
575 | int const prev_ref_count{ U->timer_deep->m_refcount.fetch_sub(1, std::memory_order_relaxed) }; | 575 | int const prev_ref_count{ U->timer_deep->m_refcount.fetch_sub(1, std::memory_order_relaxed) }; |
576 | ASSERT_L(prev_ref_count == 1); // this should be the last reference | 576 | ASSERT_L(prev_ref_count == 1); // this should be the last reference |
577 | free_deep_prelude( L, (DeepPrelude*) U->timer_deep); | 577 | free_deep_prelude(L, U->timer_deep); |
578 | U->timer_deep = nullptr; | 578 | U->timer_deep = nullptr; |
579 | } | 579 | } |
580 | 580 | ||
@@ -781,7 +781,7 @@ LUAG_FUNC( set_debug_threadname) | |||
781 | // fnv164 of string "debug_threadname" generated at https://www.pelock.com/products/hash-calculator | 781 | // fnv164 of string "debug_threadname" generated at https://www.pelock.com/products/hash-calculator |
782 | constexpr UniqueKey hidden_regkey{ 0x79C0669AAAE04440ull }; | 782 | constexpr UniqueKey hidden_regkey{ 0x79C0669AAAE04440ull }; |
783 | // C s_lane structure is a light userdata upvalue | 783 | // C s_lane structure is a light userdata upvalue |
784 | Lane* const s{ lua_touserdata<Lane>(L, lua_upvalueindex(1)) }; | 784 | Lane* const s{ lua_tolightuserdata<Lane>(L, lua_upvalueindex(1)) }; |
785 | luaL_checktype( L, -1, LUA_TSTRING); // "name" | 785 | luaL_checktype( L, -1, LUA_TSTRING); // "name" |
786 | lua_settop( L, 1); | 786 | lua_settop( L, 1); |
787 | STACK_CHECK_START_ABS( L, 1); | 787 | STACK_CHECK_START_ABS( L, 1); |
@@ -1887,7 +1887,7 @@ LUAG_FUNC( configure) | |||
1887 | STACK_CHECK( L, 2); | 1887 | STACK_CHECK( L, 2); |
1888 | 1888 | ||
1889 | // Proxy userdata contents is only a 'DeepPrelude*' pointer | 1889 | // Proxy userdata contents is only a 'DeepPrelude*' pointer |
1890 | U->timer_deep = *lua_touserdata<DeepPrelude*>(L, -1); | 1890 | U->timer_deep = *lua_tofulluserdata<DeepPrelude*>(L, -1); |
1891 | // increment refcount so that this linda remains alive as long as the universe exists. | 1891 | // increment refcount so that this linda remains alive as long as the universe exists. |
1892 | U->timer_deep->m_refcount.fetch_add(1, std::memory_order_relaxed); | 1892 | U->timer_deep->m_refcount.fetch_add(1, std::memory_order_relaxed); |
1893 | lua_pop( L, 1); // settings | 1893 | lua_pop( L, 1); // settings |
@@ -1916,7 +1916,7 @@ LUAG_FUNC( configure) | |||
1916 | 1916 | ||
1917 | { | 1917 | { |
1918 | char const* errmsg; | 1918 | char const* errmsg; |
1919 | errmsg = push_deep_proxy(L, (DeepPrelude*) U->timer_deep, 0, eLM_LaneBody); // settings M timer_deep | 1919 | errmsg = push_deep_proxy(L, U->timer_deep, 0, eLM_LaneBody); // settings M timer_deep |
1920 | if( errmsg != nullptr) | 1920 | if( errmsg != nullptr) |
1921 | { | 1921 | { |
1922 | return luaL_error( L, errmsg); | 1922 | return luaL_error( L, errmsg); |