Skip to content
Snippets Groups Projects
Commit 5a8243d5 authored by Roman Tsisyk's avatar Roman Tsisyk
Browse files

Merge remote-tracking branch 'origin/1.6' into 1.7

parents c33af288 14b413c2
No related branches found
No related tags found
No related merge requests found
......@@ -141,7 +141,7 @@ lbox_slab_info(struct lua_State *L)
ratio = 100 * ((double) totals.used
/ ((double) totals.total + 0.0001));
snprintf(ratio_buf, sizeof(ratio_buf), "%0.1lf%%", ratio);
snprintf(ratio_buf, sizeof(ratio_buf), "%0.2lf%%", ratio);
/** How much address space has been already touched */
lua_pushstring(L, "items_size");
......@@ -209,7 +209,7 @@ lbox_slab_info(struct lua_State *L)
*/
ratio = 100 * ((double) quota_used(memtx_quota) /
((double) quota_total(memtx_quota) + 0.0001));
snprintf(ratio_buf, sizeof(ratio_buf), "%0.1lf%%", ratio);
snprintf(ratio_buf, sizeof(ratio_buf), "%0.2lf%%", ratio);
lua_pushstring(L, "quota_used_ratio");
lua_pushstring(L, ratio_buf);
......
......@@ -755,7 +755,7 @@ luaL_convertint64(lua_State *L, int idx, bool unsignd, int64_t *result)
*result = lua_tonumber(L, idx);
return 0;
case LUA_TCDATA:
cdata = luaL_checkcdata(L, 1, &ctypeid);
cdata = luaL_checkcdata(L, idx, &ctypeid);
switch (ctypeid) {
case CTID_CCHAR:
case CTID_INT8:
......
......@@ -163,6 +163,12 @@ test_touint64(lua_State *L)
return 0;
lua_pop(L, 1);
lua_pushliteral(L, "not a cdata");
luaL_pushuint64(L, 18446744073709551615ULL);
if (luaL_touint64(L, -1) != 18446744073709551615ULL)
return 0;
lua_pop(L, 2);
lua_pushboolean(L, 1);
return 1;
}
......@@ -180,6 +186,12 @@ test_toint64(lua_State *L)
return 0;
lua_pop(L, 1);
lua_pushliteral(L, "not a cdata");
luaL_pushuint64(L, 18446744073709551615ULL);
if (luaL_touint64(L, -1) != 18446744073709551615ULL)
return 0;
lua_pop(L, 2);
lua_pushboolean(L, 1);
return 1;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment