Note
This is a part of Advanced Compiler course homework so, it is very messy, as you can imagine a uni project would be
This project models GC environment, which is:
- Roots: live variables with data or a pointer to some heap object
- Heap: Collection of memory blocks, which are themselves are collections of memory cells And does garbage collection on presented environment
A pointer is a cell that holds an index to another cell in the heap in some memory block.
├── bin <-- entry point
├── lib
│ ├── env <-- gc environment
│ │ ├── env.ml
│ │ ├── memory.ml <-- memory model
│ │ └── roots.ml
│ └── gc <-- algorithms implementations
│ ├── copy_gc.ml
│ └── mark_and_sweep.ml
└── test
To be implemented:
- Mark and Sweep
- Copying
- Baker incremental