diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2016-08-21 08:38:20 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2016-08-21 08:38:20 -0700 |
commit | f40137f1327ad3203eff5f6894baaa68a700cec1 (patch) | |
tree | ede862c2e4b89b3dc7d1fcf28f05327982934b37 | |
parent | 10bbca643f16daf640caf040a1f86eb93e3d66e2 (diff) | |
download | mu-f40137f1327ad3203eff5f6894baaa68a700cec1.tar.gz |
3239
-rw-r--r-- | 037abandon.cc | 2 | ||||
-rw-r--r-- | 039location_array.cc | 2 | ||||
-rw-r--r-- | 044space_surround.cc | 6 | ||||
-rw-r--r-- | 046global.cc | 4 | ||||
-rw-r--r-- | 085scenario_console.cc | 8 | ||||
-rw-r--r-- | 089scenario_filesystem.cc | 2 |
6 files changed, 12 insertions, 12 deletions
diff --git a/037abandon.cc b/037abandon.cc index 014747d7..6195cdf6 100644 --- a/037abandon.cc +++ b/037abandon.cc @@ -38,7 +38,7 @@ void abandon(int address, const type_tree* payload_type, int payload_size) { assert(element.type->name != "array"); int element_size = size_of(element); for (int i = 0; i < array_length; ++i) { - element.set_value(address + /*skip refcount*/1 + /*skip array length*/1 + i*element_size); + element.set_value(address + /*skip refcount and length*/2 + i*element_size); decrement_any_refcounts(element); } } diff --git a/039location_array.cc b/039location_array.cc index 6c261dcf..814fb922 100644 --- a/039location_array.cc +++ b/039location_array.cc @@ -24,7 +24,7 @@ bool is_address_of_array_of_numbers(reagent/*copy*/ product) { :(before "End Primitive Recipe Implementations") case TO_LOCATION_ARRAY: { int array_size = SIZE(ingredients.at(0)); - int allocation_size = array_size + /*refcount*/1 + /*length*/1; + int allocation_size = array_size + /*refcount and length*/2; ensure_space(allocation_size); const int result = Current_routine->alloc; products.resize(1); diff --git a/044space_surround.cc b/044space_surround.cc index 341d25b5..733b072f 100644 --- a/044space_surround.cc +++ b/044space_surround.cc @@ -21,11 +21,11 @@ def main [ ] def dummy [ # just for the /names: property above ] -# chain space: 10 + /*skip refcount*/1 + /*skip length*/1 +# chain space: 10 + (refcount and length) 2 +mem: storing 20 in location 12 -# store to default space: 10 + /*skip refcount*/1 + /*skip length*/1 + /*index*/1 +# store to default space: 10 + (skip refcount and length) 2 + (index) 1 +mem: storing 32 in location 13 -# store to chained space: /*contents of location 12*/20 + /*skip refcount*/1 + /*skip length*/1 + /*index*/1 +# store to chained space: (contents of location 12) 20 + (refcount and length) 2 + (index) 1 +mem: storing 33 in location 23 :(before "End Checks For Reclaiming Locals") diff --git a/046global.cc b/046global.cc index 757c2a17..8c57236a 100644 --- a/046global.cc +++ b/046global.cc @@ -23,9 +23,9 @@ def main [ 1:number <- copy 23 1:number/space:global <- copy 24 ] -# store to default space: 10 + /*skip refcount*/1 + /*skip length*/1 + /*index*/1 +# store to default space: 10 + (skip refcount and length) 2 + (index) 1 +mem: storing 23 in location 13 -# store to chained space: /*contents of location 12*/20 + /*skip refcount*/1 + /*skip length*/1 + /*index*/1 +# store to chained space: (contents of location 12) 20 + (refcount and length) 2 + (index) 1 +mem: storing 24 in location 23 //: to support it, create another special variable called global space diff --git a/085scenario_console.cc b/085scenario_console.cc index c1f75735..c80c9140 100644 --- a/085scenario_console.cc +++ b/085scenario_console.cc @@ -58,7 +58,7 @@ case ASSUME_CONSOLE: { slurp_body(in, r); int num_events = count_events(r); // initialize the events like in new-fake-console - int size = /*space for refcount*/1 + /*space for length*/1 + num_events*size_of_event(); + int size = /*space for refcount and length*/2 + num_events*size_of_event(); ensure_space(size); int event_data_address = Current_routine->alloc; // store length @@ -69,9 +69,9 @@ case ASSUME_CONSOLE: { if (curr.name == "left-click") { trace(9999, "mem") << "storing 'left-click' event starting at " << Current_routine->alloc << end(); put(Memory, Current_routine->alloc, /*tag for 'touch-event' variant of 'event' exclusive-container*/2); - put(Memory, Current_routine->alloc+1+/*offset of 'type' in 'mouse-event'*/0, TB_KEY_MOUSE_LEFT); - put(Memory, Current_routine->alloc+1+/*offset of 'row' in 'mouse-event'*/1, to_integer(curr.ingredients.at(0).name)); - put(Memory, Current_routine->alloc+1+/*offset of 'column' in 'mouse-event'*/2, to_integer(curr.ingredients.at(1).name)); + put(Memory, Current_routine->alloc+/*skip tag*/1+/*offset of 'type' in 'mouse-event'*/0, TB_KEY_MOUSE_LEFT); + put(Memory, Current_routine->alloc+/*skip tag*/1+/*offset of 'row' in 'mouse-event'*/1, to_integer(curr.ingredients.at(0).name)); + put(Memory, Current_routine->alloc+/*skip tag*/1+/*offset of 'column' in 'mouse-event'*/2, to_integer(curr.ingredients.at(1).name)); Current_routine->alloc += size_of_event(); } else if (curr.name == "press") { diff --git a/089scenario_filesystem.cc b/089scenario_filesystem.cc index 8acdac0b..ef20b159 100644 --- a/089scenario_filesystem.cc +++ b/089scenario_filesystem.cc @@ -189,7 +189,7 @@ string munge_filesystem_contents(const string& data, const string& filename, con void construct_filesystem_object(const map<string, string>& contents) { int filesystem_data_address = allocate(SIZE(contents)*2 + /*array length*/1); - int curr = filesystem_data_address + /*skip refcount*/1 + /*skip array length*/1; + int curr = filesystem_data_address + /*skip refcount and length*/2; for (map<string, string>::const_iterator p = contents.begin(); p != contents.end(); ++p) { put(Memory, curr, new_mu_string(p->first)); curr++; |