https://github.com/vengarioth/genetic-gc
a garbage collector powered by machine learning and written in rust
https://github.com/vengarioth/genetic-gc
Last synced: about 1 year ago
JSON representation
a garbage collector powered by machine learning and written in rust
- Host: GitHub
- URL: https://github.com/vengarioth/genetic-gc
- Owner: Vengarioth
- Created: 2016-11-10T21:02:22.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-11-13T13:53:06.000Z (over 9 years ago)
- Last Synced: 2025-03-03T11:24:05.510Z (over 1 year ago)
- Language: Rust
- Size: 8.79 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# genetic-gc
_a machine learning approach to garbage collection_
[](https://travis-ci.org/Vengarioth/genetic-gc)
## State of the GC
1. make it work __✓__
2. make it pretty
3. make it fast
## State of the model
1. make it work
2. make it pretty
3. make it fast
## API
```rust
// TypeInformation and TestStruct omitted
let type_information = TypeInformation{};
let mut gc = GC::new(type_information);
let size = std::mem::size_of::();
let address_one = gc.allocate(size).unwrap();
let address_two = gc.allocate(size).unwrap();
gc.add_root(address_one);
gc.collect();
// address_one will still be alive since it's a root reference
assert!(gc.is_address_valid(address_one));
// address_two will be gone since nothing refers to it
assert!(!gc.is_address_valid(address_two));
```
## Licence
__MIT__