# HG changeset patch # User Matthew Wild # Date 1341770096 -3600 # Node ID e3ff2656cb37bea3e4828833390c66888e4506f2 # Parent 521976cb56e63b3c8048149f50f3ee7a6349fab4# Parent 02e5e9fa37b85ed5adc5e03fadc2f1ab3f6a02bb Merge 0.9->trunk diff -r 521976cb56e6 -r e3ff2656cb37 util-src/pposix.c --- a/util-src/pposix.c Sun Jul 08 18:49:44 2012 +0100 +++ b/util-src/pposix.c Sun Jul 08 18:54:56 2012 +0100 @@ -622,14 +622,20 @@ { struct mallinfo info = mallinfo(); lua_newtable(L); + /* This is the total size of memory allocated with sbrk by malloc, in bytes. */ lua_pushinteger(L, info.arena); lua_setfield(L, -2, "allocated"); + /* This is the total size of memory allocated with mmap, in bytes. */ lua_pushinteger(L, info.hblkhd); lua_setfield(L, -2, "allocated_mmap"); + /* This is the total size of memory occupied by chunks handed out by malloc. */ lua_pushinteger(L, info.uordblks); lua_setfield(L, -2, "used"); + /* This is the total size of memory occupied by free (not in use) chunks. */ lua_pushinteger(L, info.fordblks); lua_setfield(L, -2, "unused"); + /* This is the size of the top-most releasable chunk that normally borders the + end of the heap (i.e., the high end of the virtual address space's data segment). */ lua_pushinteger(L, info.keepcost); lua_setfield(L, -2, "returnable"); return 1;