From 4945e77a58f3ab10069461e86e5e10c06e91e489 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Mon, 29 May 2017 02:25:10 -0700 Subject: 3895 --- html/037abandon.cc.html | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'html/037abandon.cc.html') diff --git a/html/037abandon.cc.html b/html/037abandon.cc.html index fdcf071d..c2f2803a 100644 --- a/html/037abandon.cc.html +++ b/html/037abandon.cc.html @@ -81,7 +81,7 @@ if ('onhashchange' in window) { 16 :(before "End Decrement Refcount(old_address, payload_type, payload_size)") 17 if (old_refcount == 0) { 18 trace(9999, "mem") << "automatically abandoning " << old_address << end(); - 19 abandon(old_address, payload_type, payload_size); + 19 abandon(old_address, payload_type, payload_size); 20 } 21 22 //: When abandoning addresses we'll save them to a 'free list', segregated by size. @@ -90,7 +90,7 @@ if ('onhashchange' in window) { 25 map<int, int> free_list; 26 27 :(code) - 28 void abandon(int address, const type_tree* payload_type, int payload_size) { + 28 void abandon(int address, const type_tree* payload_type, int payload_size) { 29 trace(9999, "abandon") << "updating refcounts inside " << address << ": " << to_string(payload_type) << end(); 30 //? Total_free += size; 31 //? ++Num_free; @@ -98,28 +98,28 @@ if ('onhashchange' in window) { 33 // decrement any contained refcounts 34 if (is_mu_array(payload_type)) { 35 ¦ reagent/*local*/ element; - 36 ¦ element.type = copy_array_element(payload_type); - 37 ¦ int array_length = get_or_insert(Memory, address+/*skip refcount*/1); + 36 ¦ element.type = copy_array_element(payload_type); + 37 ¦ int array_length = get_or_insert(Memory, address+/*skip refcount*/1); 38 ¦ assert(element.type->name != "array"); 39 ¦ int element_size = size_of(element); - 40 ¦ for (int i = 0; i < array_length; ++i) { + 40 ¦ for (int i = 0; i < array_length; ++i) { 41 ¦ ¦ element.set_value(address + /*skip refcount and length*/2 + i*element_size); - 42 ¦ ¦ decrement_any_refcounts(element); + 42 ¦ ¦ decrement_any_refcounts(element); 43 ¦ } 44 } 45 else if (is_mu_container(payload_type) || is_mu_exclusive_container(payload_type)) { 46 ¦ reagent tmp; 47 ¦ tmp.type = new type_tree(*payload_type); 48 ¦ tmp.set_value(address + /*skip refcount*/1); - 49 ¦ decrement_any_refcounts(tmp); + 49 ¦ decrement_any_refcounts(tmp); 50 } 51 // clear memory 52 for (int curr = address; curr < address+payload_size; ++curr) 53 ¦ put(Memory, curr, 0); 54 // append existing free list to address - 55 trace(9999, "abandon") << "saving " << address << " in free-list of size " << payload_size << end(); - 56 put(Memory, address, get_or_insert(Current_routine->free_list, payload_size)); - 57 put(Current_routine->free_list, payload_size, address); + 55 trace(9999, "abandon") << "saving " << address << " in free-list of size " << payload_size << end(); + 56 put(Memory, address, get_or_insert(Current_routine->free_list, payload_size)); + 57 put(Current_routine->free_list, payload_size, address); 58 } 59 60 :(after "Allocate Special-cases") -- cgit 1.4.1-2-gfad0