lambda-mountain icon indicating copy to clipboard operation
lambda-mountain copied to clipboard

Garbage Collection

Open andrew-johnson-4 opened this issue 1 year ago • 1 comments

It is time.

  • ✓ implement malloc / free
  • ✓add parser option to mark functions as hooks (λ:Hook. y)
  • ✓ plural calling convention for fragments and functions that are marked as hooks
  • ✓ rc::new
  • ✓ single structs automatically knows its own Tag
  • ✓ inc / del Rc (decrement and destroy if count <= zero)
  • ✓ fix cdecl calling convention to work without full knowledge of stack state
  • ✓ del hooks in unframe
  • ✓ del hooks in function return, if, while
  • ✓ increment for Rc, pass through inc for all other types
  • sorted order for hook application
  • when defining constructors, if a field has a destructor, then the whole type needs a destructor too
  • Mov, Del, open, close, push, pop for rc.
    • Constructor +1
    • CopyMove +1
    • discard StackVariable -1
    • ✓ variable out of scope -1
    • StackVariables should not hold a reference (data in transit is free)?
  • Migrate compiler to reference counting, but don't free yet, and log all would-be crash sites
  • Fix all compiler reference bugs, then actually reclaim unused memory

andrew-johnson-4 avatar Sep 12 '24 23:09 andrew-johnson-4