Debugging helper functions #
Equations
- dbgTraceVal a = dbgTrace (toString a) fun (x : Unit) => a
Print stack trace to stderr before evaluating given closure. Currently supported on Linux only.
Equations
- dbgStackTrace f = f ()
Equations
- panicWithPos modName line col msg = panic (mkPanicMessage modName line col msg)
Equations
- panicWithPosWithDecl modName declName line col msg = panic (mkPanicMessageWithDecl modName declName line col msg)
Returns true
if a
is an exclusive object.
We say an object is exclusive if it is single-threaded and its reference counter is 1.
withPtrEq
for DecidableEq
Equations
- withPtrEqDecEq a b k = match h : withPtrEq a b (fun (x : Unit) => toBoolUsing (k ())) ⋯ with | true => isTrue ⋯ | false => isFalse ⋯
Equations
- withPtrAddr a k h = k 0
Marks given value and its object graph closure as multi-threaded if currently marked single-threaded. This will make reference counter updates atomic and thus more costly. It can still be useful to do eagerly when the value will be shared between threads later anyway and there is available time budget to mark it now.
Equations
Marks given value and its object graph closure as persistent. This will remove reference counter updates but prevent the closure from being deallocated until the end of the process! It can still be useful to do eagerly when the value will be marked persistent later anyway and there is available time budget to mark it now or it would be unnecessarily marked multi-threaded in between.