master
memory-models
Memory models in C for researching static compiler analysis
Many people overhype the rust borrow checker, i'm going to prove how terrible it is by creating a better memory model.
Current iteration
It's called sc (scope counting), think of it as a relative counter to the lifetime of a variable.
{
let x = Box::new(10); // sc = 0
// sc is 0, drop it
}
let r; // sc = 0
{
// sc of r = -1 (relative to current scope)
let x = Box::new(10); // sc = 0
r = &x; // sc of x = -(sc of r) aka 1
// sc is 1, don't drop it
}
// sc is 0, drop it
Languages
C
96.3%
Shell
3.7%