Almost solved writing my own binding system ;-) Surely not as complete as sqrat, but much less ram-hungry, and able to overload constructors and functions with same number of parameters (buti different signatures) : // nested tables test Table("atable", v) .Value("aval", "7777") .Value("aval2", 8888) .Func<const char *, const char *>("pippo", pippo) .Table("another") .Value("otherval", "myval") .Func<int, int>("fact", fact) .Table("onemore") .Value("lastval", "that's all folks...") .Func<float, float>("fact",...
I'll see if I stumble in other cases... by now I only noticed on the Class creation, but I didn't test it in depth. BTW... sqrat is eating quite a lot of RAM for bindings... I'll see if I can keep it or fallback to a more "manual" binding. More than 2.4K of RAM for a class declaration seems really much.
This one: ~ClassData() { #ifdef NO_GARBAGE_COLLECTOR sq_release(0, &classObj); sq_release(0, &getTable); sq_release(0, &setTable); instances.Reset(); staticData.Reset(); #endif Solves the issue for me. on builds wihtout GC the VM parameter of sq_release() is not used, so we can safely put it to NULL and spare a VM object inside ClassData struct.
Yes, it runs, but it seems to not free anything besides the object itself. I'll try to add a destructor to ClassData and see if it gets called....
Hi, IMHO they shall be cleaned up when the VM is closed. That happens (by casuality, because GC is invoked on VM destruction), but not without GC. I'm avoiding the GC because I'm trying to squeeze at most the RAM size of squirrel on a PIC32 controller. Shouldn't be Sqrat object cleaned automatically by cleanup_hook() ?
Memory leak with NO_GARBAGE_COLLECTOR