forked from LuaJIT/LuaJIT
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add lua_cpcall2 for VA is larger than 47bit
A new API is added to work around issue when VA (virtual address) is > 47 bit in lua_cpcall API: LUA_API int (lua_cpcall2) (lua_State *L, lua_CFunction func, void *ud); In new API, the "ud" is wrapped in userdata instead of as lightuserdata directly. So user's code needs modification to use new API. To get real user data in "ud", user has to do double de-reference to un-wrap "ud". e.g.: int callback(lua_State *L) { int *ud = (int *)lua_touserdata(L, -1); *ud = 2; return 0; } needs update to: int callback(lua_State *L) { int **ud = (int **)lua_touserdata(L, -1); **ud = 2; return 0; } Change-Id: I3241237284cb208336d9503f2e33d2591691049a Jira: ENTLLT-427
- Loading branch information
Showing
2 changed files
with
23 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters