non-static data intialization removed, moved to constructor

This commit is contained in:
mariusmonton 2018-09-27 14:32:40 +02:00
parent 2cf3694691
commit 70de804983
2 changed files with 16 additions and 8 deletions

View File

@ -90,13 +90,13 @@ private:
static Performance* instance; static Performance* instance;
Performance(); Performance();
uint64_t data_memory_read = 0; uint64_t data_memory_read;
uint64_t data_memory_write = 0; uint64_t data_memory_write;
uint64_t code_memory_read = 0; uint64_t code_memory_read;
uint64_t code_memory_write = 0; uint64_t code_memory_write;
uint64_t register_read = 0; uint64_t register_read;
uint64_t register_write = 0; uint64_t register_write;
uint64_t instructions_executed = 0; uint64_t instructions_executed;
}; };
#endif #endif

View File

@ -11,7 +11,15 @@ Performance* Performance::getInstance()
} }
Performance::Performance() Performance::Performance()
{} {
data_memory_read = 0;
data_memory_write = 0;
code_memory_read = 0;
code_memory_write = 0;
register_read = 0;
register_write = 0;
instructions_executed = 0;
}
void Performance::dump() { void Performance::dump() {
cout << dec << "# data memory reads: " << data_memory_read << endl; cout << dec << "# data memory reads: " << data_memory_read << endl;