From cd9bb850caeca88747a25436fc65c67c6d5cd89a Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Sat, 27 Aug 2016 20:49:03 -0700 Subject: 3266 --- html/089scenario_filesystem.cc.html | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) (limited to 'html/089scenario_filesystem.cc.html') diff --git a/html/089scenario_filesystem.cc.html b/html/089scenario_filesystem.cc.html index 6dc1faa3..0f9b51b6 100644 --- a/html/089scenario_filesystem.cc.html +++ b/html/089scenario_filesystem.cc.html @@ -222,21 +222,34 @@ string munge_filesystem_contents(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++; + trace(9999, "mem") << "storing file name " << get(Memory, curr) << " in location " << curr << end(); + put(Memory, get(Memory, curr), 1); + trace(9999, "mem") << "storing refcount 1 in location " << get(Memory, curr) << end(); + ++curr; put(Memory, curr, new_mu_string(p->second)); - curr++; + trace(9999, "mem") << "storing file contents " << get(Memory, curr) << " in location " << curr << end(); + put(Memory, get(Memory, curr), 1); + trace(9999, "mem") << "storing refcount 1 in location " << get(Memory, curr) << end(); + ++curr; } - put(Memory, filesystem_data_address+/*skip refcount*/1, SIZE(contents)); // size of array + curr = filesystem_data_address+/*skip refcount*/1; + put(Memory, curr, SIZE(contents)); // size of array + trace(9999, "mem") << "storing filesystem size " << get(Memory, curr) << " in location " << curr << end(); put(Memory, filesystem_data_address, 1); // initialize refcount + trace(9999, "mem") << "storing refcount 1 in location " << filesystem_data_address << end(); // wrap the filesystem data in a filesystem object int filesystem_address = allocate(size_of_filesystem()); - put(Memory, filesystem_address+/*skip refcount*/1, filesystem_data_address); + curr = filesystem_address+/*skip refcount*/1; + put(Memory, curr, filesystem_data_address); + trace(9999, "mem") << "storing filesystem data address " << filesystem_data_address << " in location " << curr << end(); put(Memory, filesystem_address, 1); // initialize refcount + trace(9999, "mem") << "storing refcount 1 in location " << filesystem_address << end(); // save in product put(Memory, FILESYSTEM, filesystem_address); + trace(9999, "mem") << "storing filesystem address " << filesystem_address << " in location " << FILESYSTEM << end(); } int size_of_filesystem() { -- cgit 1.4.1-2-gfad0