diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2015-08-28 23:21:48 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2015-08-28 23:25:21 -0700 |
commit | 6c1376f8307a3c7b98dfd5ef09670bd15c05f399 (patch) | |
tree | 7baa415602234e3619a710f4c23907666ef4b716 /043new.cc | |
parent | c769b878f65247fff2f4dabaf7948709ff1dcadb (diff) | |
download | mu-6c1376f8307a3c7b98dfd5ef09670bd15c05f399.tar.gz |
2095
Finally terminate the experiment of keeping debug prints around. I'm also going to give up on maintaining counts. What we really need is two kinds of tracing: a) For tests, just the domain-specific facts, organized by labels. b) For debugging, just transient dumps to stdout. b) only works if stdout is clean by default. Hmm, I think this means 'stash' should be the transient kind of trace.
Diffstat (limited to '043new.cc')
-rw-r--r-- | 043new.cc | 37 |
1 files changed, 18 insertions, 19 deletions
diff --git a/043new.cc b/043new.cc index 42608264..2594dc5d 100644 --- a/043new.cc +++ b/043new.cc @@ -80,8 +80,8 @@ case NEW: { size = size_of(type); } } -//? Total_alloc += size; //? 1 -//? Num_alloc++; //? 1 +//? Total_alloc += size; +//? Num_alloc++; // compute the region of memory to return // really crappy at the moment ensure_space(size); @@ -104,17 +104,17 @@ case NEW: { break; } -//? :(before "End Globals") //? 1 -//? long long int Total_alloc = 0; //? 1 -//? long long int Num_alloc = 0; //? 1 -//? long long int Total_free = 0; //? 1 -//? long long int Num_free = 0; //? 1 -//? :(before "End Setup") //? 1 -//? Total_alloc = Num_alloc = Total_free = Num_free = 0; //? 1 -//? :(before "End Teardown") //? 1 -//? cerr << Total_alloc << "/" << Num_alloc //? 1 -//? << " vs " << Total_free << "/" << Num_free << '\n'; //? 1 -//? cerr << SIZE(Memory) << '\n'; //? 1 +//? :(before "End Globals") +//? long long int Total_alloc = 0; +//? long long int Num_alloc = 0; +//? long long int Total_free = 0; +//? long long int Num_free = 0; +//? :(before "End Setup") +//? Total_alloc = Num_alloc = Total_free = Num_free = 0; +//? :(before "End Teardown") +//? cerr << Total_alloc << "/" << Num_alloc +//? << " vs " << Total_free << "/" << Num_free << '\n'; +//? cerr << SIZE(Memory) << '\n'; :(code) void ensure_space(long long int size) { @@ -236,9 +236,9 @@ case ABANDON: { :(code) void abandon(long long int address, long long int size) { -//? Total_free += size; //? 1 -//? Num_free++; //? 1 -//? cerr << "abandon: " << size << '\n'; //? 2 +//? Total_free += size; +//? Num_free++; +//? cerr << "abandon: " << size << '\n'; // clear memory for (long long int curr = address; curr < address+size; ++curr) Memory[curr] = 0; @@ -328,9 +328,8 @@ if (is_literal(current_instruction().ingredients.at(0)) long long int new_mu_string(const string& contents) { // allocate an array just large enough for it long long int string_length = unicode_length(contents); -//? cout << "string_length is " << string_length << '\n'; //? 1 -//? Total_alloc += string_length+1; //? 1 -//? Num_alloc++; //? 1 +//? Total_alloc += string_length+1; +//? Num_alloc++; ensure_space(string_length+1); // don't forget the extra location for array size // initialize string long long int result = Current_routine->alloc; |