2026-05-13 23:54:14 +02:00
2026-05-13 22:53:52 +02:00
2026-05-13 22:24:42 +02:00
2026-05-13 23:53:12 +02:00
2026-05-13 22:53:52 +02:00
2026-05-13 23:53:12 +02:00

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
S
Description
Memory models in C for researching static compiler analysis
Readme Apache-2.0
33 KiB
Languages
C 96.3%
Shell 3.7%