Skip to content

Commit

Permalink
fix: use lua_pushunsigned, avoid to singed on 32 bits ARCH.
Browse files Browse the repository at this point in the history
  • Loading branch information
zhaozg committed May 20, 2023
1 parent 6dca7a5 commit 38cb8d4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -760,7 +760,7 @@ static int luv_cpumask_size(lua_State* L) {
}

static int luv_get_available_memory(lua_State* L) {
lua_pushinteger(L, uv_get_available_memory());
lua_pushnumber(L, uv_get_available_memory());
return 1;
}

Expand Down
2 changes: 1 addition & 1 deletion tests/test-misc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ return require('lib/tap')(function (test)
local available = nil
if uv.get_available_memory then
available = uv.get_available_memory()
assert(available >= 0)
assert(available >= 0, available)
end
local free = uv.get_free_memory()
p{rss=rss,total=total,free=free,available=available,constrained=constrained}
Expand Down

0 comments on commit 38cb8d4

Please sign in to comment.