aboutsummaryrefslogtreecommitdiffstats
path: root/util-src
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2012-07-08 18:54:30 +0100
committerMatthew Wild <mwild1@gmail.com>2012-07-08 18:54:30 +0100
commit1c1baa42c8a2c047f938a442d776f33320013c0c (patch)
treef2e3c7ae2e53aaf8dccffefb5e7ca4ea02ffed26 /util-src
parent28df9086d844e7a8ca6f26b55fe6297e044e7be7 (diff)
downloadprosody-1c1baa42c8a2c047f938a442d776f33320013c0c.tar.gz
prosody-1c1baa42c8a2c047f938a442d776f33320013c0c.zip
util.pposix: Add comments to mallinfo fields we use, so I don't forget tomorrow what they mean
Diffstat (limited to 'util-src')
-rw-r--r--util-src/pposix.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/util-src/pposix.c b/util-src/pposix.c
index 8dfd6c75..65f8b4ab 100644
--- a/util-src/pposix.c
+++ b/util-src/pposix.c
@@ -622,14 +622,20 @@ int lc_meminfo(lua_State* L)
{
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;