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 5799084572

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.
This commit is contained in:
feos 2019-10-19 11:37:01 +03:00
parent bfbe918626
commit d51d2a71d5
2 changed files with 1125 additions and 1084 deletions

View File

@ -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<typename U, U> struct Check;

File diff suppressed because it is too large Load Diff