diff options
author | Benoit Germain <benoit.germain@ubisoft.com> | 2024-05-24 08:59:08 +0200 |
---|---|---|
committer | Benoit Germain <benoit.germain@ubisoft.com> | 2024-05-24 08:59:08 +0200 |
commit | 18ab2be6ddaf5beb86e429cce9a3e1b4b5703b42 (patch) | |
tree | 5b8645817abe4eb1123647a4e9c5204d0e35d9b1 /src/lanes.cpp | |
parent | 3be94c4282bbe77895e952afb12a81e55c2a4391 (diff) | |
download | lanes-18ab2be6ddaf5beb86e429cce9a3e1b4b5703b42.tar.gz lanes-18ab2be6ddaf5beb86e429cce9a3e1b4b5703b42.tar.bz2 lanes-18ab2be6ddaf5beb86e429cce9a3e1b4b5703b42.zip |
Process upvalues equal to G_ in Lua51 as in other flavors
Diffstat (limited to 'src/lanes.cpp')
-rw-r--r-- | src/lanes.cpp | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/lanes.cpp b/src/lanes.cpp index 000668a..8033de7 100644 --- a/src/lanes.cpp +++ b/src/lanes.cpp | |||
@@ -505,17 +505,13 @@ LUAG_FUNC(lane_new) | |||
505 | 505 | ||
506 | // ################################################################################################ | 506 | // ################################################################################################ |
507 | 507 | ||
508 | #if HAVE_LANE_TRACKING() | ||
509 | //--- | ||
510 | // threads() -> {}|nil | 508 | // threads() -> {}|nil |
511 | // | ||
512 | // Return a list of all known lanes | 509 | // Return a list of all known lanes |
513 | LUAG_FUNC(threads) | 510 | LUAG_FUNC(threads) |
514 | { | 511 | { |
515 | LaneTracker const& _tracker = universe_get(L_)->tracker; | 512 | LaneTracker const& _tracker = universe_get(L_)->tracker; |
516 | return _tracker.pushThreadsTable(L_); | 513 | return _tracker.pushThreadsTable(L_); |
517 | } | 514 | } |
518 | #endif // HAVE_LANE_TRACKING() | ||
519 | 515 | ||
520 | // ################################################################################################# | 516 | // ################################################################################################# |
521 | // ######################################## Timer support ########################################## | 517 | // ######################################## Timer support ########################################## |
@@ -652,13 +648,14 @@ LUAG_FUNC(configure) | |||
652 | std::ignore = luaG_getfield(L_, 1, "demote_full_userdata"); // L_: settings demote_full_userdata | 648 | std::ignore = luaG_getfield(L_, 1, "demote_full_userdata"); // L_: settings demote_full_userdata |
653 | _U->demoteFullUserdata = lua_toboolean(L_, -1) ? true : false; | 649 | _U->demoteFullUserdata = lua_toboolean(L_, -1) ? true : false; |
654 | lua_pop(L_, 1); // L_: settings | 650 | lua_pop(L_, 1); // L_: settings |
655 | #if HAVE_LANE_TRACKING() | 651 | |
652 | // tracking | ||
656 | std::ignore = luaG_getfield(L_, 1, "track_lanes"); // L_: settings track_lanes | 653 | std::ignore = luaG_getfield(L_, 1, "track_lanes"); // L_: settings track_lanes |
657 | if (lua_toboolean(L_, -1)) { | 654 | if (lua_toboolean(L_, -1)) { |
658 | _U->tracker.activate(); | 655 | _U->tracker.activate(); |
659 | } | 656 | } |
660 | lua_pop(L_, 1); // L_: settings | 657 | lua_pop(L_, 1); // L_: settings |
661 | #endif // HAVE_LANE_TRACKING() | 658 | |
662 | // Linked chains handling | 659 | // Linked chains handling |
663 | _U->selfdestructFirst = SELFDESTRUCT_END; | 660 | _U->selfdestructFirst = SELFDESTRUCT_END; |
664 | _U->initializeAllocatorFunction(L_); | 661 | _U->initializeAllocatorFunction(L_); |
@@ -690,13 +687,13 @@ LUAG_FUNC(configure) | |||
690 | lua_setfield(L_, -2, "configure"); // L_: settings M | 687 | lua_setfield(L_, -2, "configure"); // L_: settings M |
691 | // add functions to the module's table | 688 | // add functions to the module's table |
692 | luaG_registerlibfuncs(L_, global::sLanesFunctions); | 689 | luaG_registerlibfuncs(L_, global::sLanesFunctions); |
693 | #if HAVE_LANE_TRACKING() | 690 | |
694 | // register core.threads() only if settings say it should be available | 691 | // register core.threads() only if settings say it should be available |
695 | if (_U->tracker.isActive()) { | 692 | if (_U->tracker.isActive()) { |
696 | lua_pushcfunction(L_, LG_threads); // L_: settings M LG_threads() | 693 | lua_pushcfunction(L_, LG_threads); // L_: settings M LG_threads() |
697 | lua_setfield(L_, -2, "threads"); // L_: settings M | 694 | lua_setfield(L_, -2, "threads"); // L_: settings M |
698 | } | 695 | } |
699 | #endif // HAVE_LANE_TRACKING() | 696 | |
700 | STACK_CHECK(L_, 2); | 697 | STACK_CHECK(L_, 2); |
701 | 698 | ||
702 | { | 699 | { |