Started with a rough structure

This commit is contained in:
Victor Olin 2023-02-09 13:18:58 +01:00
parent 3852583f08
commit 17d41a408d
6 changed files with 153 additions and 11 deletions

34
src/GC/todo.md Normal file
View file

@ -0,0 +1,34 @@
# Garbage collection
## Algorithm
Potential algorithms:
- mark & sweep
- easy to implement
- slow
- mark & compact
- no memory fragmentation
- slow
- stop-copy algorithms (?)
- no memory fragmentation
- slow
- maybe good for FP langs?
## Type hierarchy
- Heap class
- Holds all memory
- Resizeable array?
- Singleton instance
- Allocator class
- Allocates chunks of memory
- keeps track of chunks that are available and their sizes
- Several instances of allocator class with different sizes?
- HeapObj class
- parent of all heap objects
- contains metadata
- size
- location
- marked bit