Hi, was experimenting with this library and noticed some issues w/ the benchmarking code:
Per the documentation of luaL_loadstring: "This function returns the same results as lua_load", which, if there are no errors, is a "compiled chunk as a Lua function on top of the stack". However, since heapsort.luareturns a function, the single call to lua_pcallk does not actually execute the heapsort, it returns the function to execute the heapsort, e.g.:
Hi, was experimenting with this library and noticed some issues w/ the benchmarking code:
Per the documentation of luaL_loadstring: "This function returns the same results as lua_load", which, if there are no errors, is a "compiled chunk as a Lua function on top of the stack". However, since heapsort.lua returns a function, the single call to lua_pcallk does not actually execute the heapsort, it returns the function to execute the heapsort, e.g.:
One potential solution:
Additionally, the Fengari bits require some tweaking, e.g.,