Re: Memory tracking in GJS


A little late here.  SM's GC needs to know about all allocations that it
might collect, both those that it can trace and those that it can't.
Ideally GLib could define an interface

  void g_register_allocation (size_t bytes, char *for_whom);

and GJS should register some listener on that allocation recorder, which
then bumps SM's mallocation counter (which would then cause GC to happen
more frequently -- but not "all the time", rather when needed.  Of
course then you have to patch gdk-pixbuf and everyone else to record
allocations, but that's cheap and doable -- basically it's just
gdk-pixbuf and the slice allocator anyway, no?

To do otherwise is to solve most problems but leave some pathological
cases unhandled.



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