From d51d2a71d58ea17238ad65612040f68fb407c3c1 Mon Sep 17 00:00:00 2001 From: feos Date: Sat, 19 Oct 2019 11:37:01 +0300 Subject: luaengine: reduce memory usage during compilation Previous semantics were encouraged by sol2, and ThePhD admitted it was a bad idea for usertypes with lots of members. sol3 allows to assign members outside a constructor for regular usertypes, but mame can't move to sol3 because it requires C++17. Turns out sol2 also has a way to add members separately, and that is what I used. This helps immensely. This approach required a fix to warning C5046 copied from here https://github.com/ThePhD/sol2/commit/57990845726e17fba11a39cfcb1fc0127a7ea638 Tested current mame plugins, everything seems to work. PS: Due to come black magic, if I use simple_usertype::set() with "manager" as well, "machine" member dies (others are fine!), so I had to leave it intact. --- 3rdparty/sol2/sol/traits.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to '3rdparty/sol2/sol/traits.hpp') diff --git a/3rdparty/sol2/sol/traits.hpp b/3rdparty/sol2/sol/traits.hpp index 1ed95a1656e..762bc84b947 100644 --- a/3rdparty/sol2/sol/traits.hpp +++ b/3rdparty/sol2/sol/traits.hpp @@ -252,7 +252,7 @@ namespace sol { using yes = char; using no = struct { char s[2]; }; - struct F { void operator()(); }; + struct F { void operator()() {}; }; struct Derived : T, F {}; template struct Check; -- cgit v1.2.3-70-g09d2