Conversation
src/luawasm.ts
Outdated
| this.lua_pushnumber = this.cwrap('lua_pushnumber', null, ['number', 'number']) | ||
| this.lua_pushinteger = this.cwrap('lua_pushinteger', null, ['number', 'number']) | ||
| this.lua_pushlstring = this.cwrap('lua_pushlstring', 'string', ['number', 'string|number', 'number']) | ||
| this.lua_ptr_pushlstring = this.cwrap('lua_pushlstring', 'string', ['number', 'string|number', 'number']) |
There was a problem hiding this comment.
The return type here is string, but you added the return as number on the field?
|
Tests are failing, can you take a look? |
|
I guess this fixes #122? |
Looks like linter issues, will fix it, thanks
Yeap, as I wrote in the description, this aproach is a bit different than what is implemented now in wasmoon, you prefer not to copy the data to C memory, and only pass a reference to it ( I guess performance reasons), but it has some limitations
Right I will fix it thanks, the idea here is that it returns a pointer, not sure how it worked like that for me :D |
|
Fixed lint issues (not related to the PR, for some reason it failed) |
This PR addresses two issues
This PR handles it by reading the data directly from C memory to JS memory - Its up to you if u want to handle it this way, as it can affect performance, since it requires extra allocations
This PR handles it by reading JS memory to C memory - It may be handled differentley by mocking string meta methods