Skip to content

Add optimization for calls to LuaClass methods within Lua #4

@TheModMaker

Description

@TheModMaker

If a method defined on a class is called from within Lua, it is boxed, converted, then converted back and unboxed. It would be better to detect that the method is defined in Lua and call it directly to avoid the extra boxing and conversions.

Example:

interface ITest {
  int Do();
}
class Test : ITest

function Test::Do()
  return 12
end

local obj = Test()
local x = obj:Do()

In this example, the call to Do will first return the 12 as a double in a multi-value. Then it is converted to an integer in a wrapper function for the C# interface. Then it is boxed and converted back to a double to store in the variable x.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions