3 -- Crazy profiling madness
4 -- sed -i s/{/QH_RegisterTable{/g `ls | grep lua | grep -v static`
6 -- This is grimness so we can just apply the filter indiscriminately
9 QH_RegisterTable
= function(...) return QHRT(...) end
11 local QH_RegisterTable
= function(...) return ... end
13 QHT_Types
= setmetatable({}, {__mode
="k"})
15 QHRT
= function(tab
, override
, tag)
16 if not override
then assert(not QHT_Types
[tab
]) end
17 QHT_Types
[tab
] = tag or string.gsub(debugstack(2, 1, 1), "\n.*", "")
20 function QH_CTprint(sum
)
22 for k
, v
in pairs(sum
) do
23 table.insert(typ
, {k
= k
, v
= v
})
26 table.sort(typ
, function(a
, b
) return a
.v
< b
.v
end)
28 for _
, v
in pairs(typ
) do
36 for k
, v
in pairs(QHT_Types
) do
37 sum
[v
] = (sum
[v
] or 0) + 1
43 function QH_CheckTables()
44 local before
= QH_CTacu()
45 collectgarbage("collect")
46 local after
= QH_CTacu()
49 for k
, v
in pairs(before
) do sum
[k
] = (before
[k
] or 0) - (after
[k
] or 0) end
50 for k
, v
in pairs(after
) do sum
[k
] = (before
[k
] or 0) - (after
[k
] or 0) end
53 function QH_PrintTables()
54 QH_CTprint(QH_CTacu())
60 QuestHelper_Loadtime
= {}
61 QuestHelper_File
["bst_pre.lua"] = "Development Version"
62 QuestHelper_Loadtime
["bst_pre.lua"] = GetTime()