Skip to content

Plain C cached #3

@ghost

Description

In the name of fairness, maybe you should add a cached function call for the Lua C API. You can do this by looking up the function to call and storing it in the stack, then on each iteration you can then call lua_pushvalue[1] to copy the value (this would ensure the stack index is not popped when the function is called). Alternatively, you could store the function in the registry and use lua_geti [2] / lua_rawgeti [3].

[1] http://www.lua.org/manual/5.3/manual.html#lua_pushvalue
[2] http://www.lua.org/manual/5.3/manual.html#lua_geti
[3] http://www.lua.org/manual/5.3/manual.html#lua_rawgeti

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions