ffwff / lilith

x86-64 os made in crystal
Other
1.15k stars 27 forks source link

Rewrite garbage collector and memory allocator #9

Open ffwff opened 4 years ago

ffwff commented 4 years ago

The current incremental garbage collector/memory allocator is great and all but leaves a lot to be desired. I'm thinking of rewriting a new one.

GC

Ideas

Memory allocator

jkthorne commented 4 years ago

Is this for the main Crystal Lang or for Lilith specifically?

ffwff commented 4 years ago

Both? The compiler will be patched to output additional garbage collector data which can then be used by the new GC. The new GC will hopefully be more portable so it can be reused in userspace's libcrystal

jkthorne commented 4 years ago

That is awesome I cannot wait to see what you end up doing :)

dscottboggs commented 4 years ago

What's the status of this feature, and where can it be found? I'm curious about the possibility of merging your GC into the stdlib

ffwff commented 4 years ago

@dscottboggs It's pretty complete on the OS so far, I haven't had crashes. I tried porting it to crystal proper, but I couldn't get it working (I think this is because the actual stdlib uses much more complex data structures than mine does).

But feel free to port it I guess, all of it lies under the src/alloc directory.