From acce384bcc88d5b300b913c14b9872081a182155 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Wed, 3 Jan 2018 00:31:10 -0800 Subject: 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? --- 072recipe.cc | 3 --- 1 file changed, 3 deletions(-) (limited to '072recipe.cc') diff --git a/072recipe.cc b/072recipe.cc index e76db812..fc53df09 100644 --- a/072recipe.cc +++ b/072recipe.cc @@ -97,9 +97,6 @@ case CALL: { Current_routine->calls.push_front(call(ingredients.at(0).at(0))); ingredients.erase(ingredients.begin()); // drop the callee finish_call_housekeeping(call_instruction, ingredients); - Num_refcount_updates[caller_frame.running_recipe][caller_frame.running_step_index] - += (Total_refcount_updates - initial_num_refcount_updates); - initial_num_refcount_updates = Total_refcount_updates; // not done with caller write_products = false; fall_through_to_next_instruction = false; -- cgit 1.4.1-2-gfad0