https://github.com/raezil/gc-go
simple implementation of GC three color marking algorithm in golang
https://github.com/raezil/gc-go
algorithms algorithms-implemented garbage-collector golang
Last synced: 4 months ago
JSON representation
simple implementation of GC three color marking algorithm in golang
- Host: GitHub
- URL: https://github.com/raezil/gc-go
- Owner: Raezil
- Created: 2024-09-13T15:57:27.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2024-09-24T16:04:00.000Z (9 months ago)
- Last Synced: 2025-01-13T21:44:36.325Z (5 months ago)
- Topics: algorithms, algorithms-implemented, garbage-collector, golang
- Language: Go
- Homepage:
- Size: 4.88 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Garbage collector three color marking.
Object has references of objects and colour. Initialy root object starts being gray, those objects on heap starts as white.Black objects are reachable, gray objects are gonna be processed in the future and white objects are unreachable.
Algorithm traverses through references of object, changing those objects' colours to gray. Once every object in the reference is gray, the main object becomes black. It continues to the moment there are no more gray objects to proceed. White objects that left on heap are gonna be collected by garbage collector.