diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2018-01-03 00:31:10 -0800 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2018-01-03 00:44:09 -0800 |
commit | acce384bcc88d5b300b913c14b9872081a182155 (patch) | |
tree | a21c33d342c44382b08e37a212a2e79416baca45 /074wait.cc | |
parent | c8eb6c1a64d76dc9a1005571c4eb71ddc6d8f2a9 (diff) | |
download | mu-acce384bcc88d5b300b913c14b9872081a182155.tar.gz |
4179 - experiment: rip out memory reclamation
I have a plan for a way to avoid use-after-free errors without all the overheads of maintaining refcounts. Has the nice side-effect of requiring manual memory management. The Mu way is to leak memory by default and build tools to help decide when and where to expend effort plugging memory leaks. Arguably programs should be distributed with summaries of their resource use characteristics. Eliminating refcount maintenance reduces time to run tests by 30% for `mu edit`: this commit parent mu test: 3.9s 4.5s mu test edit: 2:38 3:48 Open questions: - making reclamation easier; some sort of support for destructors - reclaiming local scopes (which are allocated on the heap) - should we support automatically reclaiming allocations inside them?
Diffstat (limited to '074wait.cc')
-rw-r--r-- | 074wait.cc | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/074wait.cc b/074wait.cc index cf8df58c..eb17c8aa 100644 --- a/074wait.cc +++ b/074wait.cc @@ -263,23 +263,21 @@ def main [ # 'get-location' can read from container address def main [ 1:num <- copy 10 - # 10 reserved for refcount - 11:num <- copy 34 - 12:num <- copy 35 + 10:num <- copy 34 + 11:num <- copy 35 4:location <- get-location 1:&:point/lookup, 0:offset ] -+mem: storing 11 in location 4 ++mem: storing 10 in location 4 :(scenario get_location_indirect_2) def main [ 1:num <- copy 10 - # 10 reserved for refcount - 11:num <- copy 34 - 12:num <- copy 35 + 10:num <- copy 34 + 11:num <- copy 35 4:&:num <- copy 20/unsafe 4:&:location/lookup <- get-location 1:&:point/lookup, 0:offset ] -+mem: storing 11 in location 21 ++mem: storing 10 in location 20 //: allow waiting on a routine to complete |