phantomuserland
phantomuserland copied to clipboard
Dynamic arena allocation
vm/lowmem.h
See #125 too
Currently number and size of arenas are hardcoded. Must be allocated dynamically. Must have per-thread arenas for small and medium-sized objects to overcome giant mutex in allocator.
See phantom/vm/alloc.c
Store arena info in special objects of .internal.arena type? To be consistent?
Add to thread object ref to its personal arena
Reclaim thread arena - pass it to global allocator on thread death
Allocate new thread arena if last one is full
Allocate from thread arena with no mutex
NB! Add visual debugging tool to debug window showing map of object memory (alloc/free status) - not so simple, can't touch object mem now and then, need allocator to support pixel map on allocating/freeing.
Each arena is started with arena marker object. All markers are linked in a list to rebuild arena map on restart. First marker is @0? Or after the root object?
Seems to be done now. arena branch. testing.