lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

Wait... That's some kind of Dark Magic :) :)

I'll check it out later...


On 4/18/2012 2:35 PM, Robert G. Jakabosky wrote:
On Wednesday 18, Dimiter 'malkia' Stanev wrote:
This is great information, and I've learned a bit more about GC.

Mike, would it be possible to include some kind of stats (or would that
be wasteful in CPU resources) - for example count table - how many times
of each type, or each group have been found to be still alive.

something like

print( gcstat["table"] ) ->  5000 tables
print( gcstat["thread"] ) ->  100 threads

or b type

print( gcstat[3] ) ->  5100 (threads + tables).

  >     0: nil, boolean, number, lightuserdata
  >     1: string, cdata (LuaJIT only)
  >     2: upvalue, userdata, closure, prototype (medium fan-out)
  >     3: table (hash, array), thread (stack)

Even some heuristic would be good enough start?

This would definitely change my way of doing thing (I'm dealing with
lots of geometry - meshes, vertices, and I think I'll stick my guns to
use "C" structures and arrays for data that is cooked, and lua
structures for live/editing of it - and functions to transfer from one
to another).


I created a tool for finding out how many strings/tables/userdata/cdata values
are alive, it uses luatraverse [1] and lua-getsize [2].  lua-getsize is not
used when running under LuaJIT.

If the owner of luatraverse wants too include the attached code as an example
in that project feel free to include ;)