phantomuserland icon indicating copy to clipboard operation
phantomuserland copied to clipboard

Dynamic arena allocation

Open dzavalishin opened this issue 8 years ago • 4 comments

vm/lowmem.h

See #125 too

dzavalishin avatar Mar 15 '16 05:03 dzavalishin

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

dzavalishin avatar Mar 26 '18 15:03 dzavalishin

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.

dzavalishin avatar Sep 28 '19 13:09 dzavalishin

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?

dzavalishin avatar Oct 21 '19 16:10 dzavalishin

Seems to be done now. arena branch. testing.

dzavalishin avatar Oct 23 '19 01:10 dzavalishin