diff options
author | Paul Oliver <contact@pauloliver.dev> | 2024-02-29 02:29:14 +0100 |
---|---|---|
committer | Paul Oliver <contact@pauloliver.dev> | 2024-02-29 02:29:14 +0100 |
commit | 36e1e5222d094714e673506d857e6d93cdcd8e38 (patch) | |
tree | 88fdc7a07cf63d73208220808409089bd25e31fb /src | |
parent | da015293b605f82399361f12cff367ebf70eaf69 (diff) |
Removed executed instruction counter.
[#17] After having removed organisms' reward/punishment mechanisms,
the number of executed instructions will always match the number of
processes. No need to keep this.
Diffstat (limited to 'src')
-rw-r--r-- | src/process.c | 8 |
1 files changed, 0 insertions, 8 deletions
diff --git a/src/process.c b/src/process.c index 7483aa7..d997c9b 100644 --- a/src/process.c +++ b/src/process.c @@ -15,7 +15,6 @@ static uint32 g_count; static uint32 g_capacity; static uint32 g_first; static uint32 g_last; -static uint32 g_instructions_executed; static Process *g_procs; void _sal_proc_init(void) @@ -45,7 +44,6 @@ void _sal_proc_quit(void) g_capacity = 0; g_first = 0; g_last = 0; - g_instructions_executed = 0; g_procs = NULL; } @@ -60,7 +58,6 @@ void _sal_proc_load_from(FILE *file) fread(&g_capacity, sizeof(uint32), 1, file); fread(&g_first, sizeof(uint32), 1, file); fread(&g_last, sizeof(uint32), 1, file); - fread(&g_instructions_executed, sizeof(uint32), 1, file); g_procs = calloc(g_capacity, sizeof(Process)); assert(g_procs); fread(g_procs, sizeof(Process), g_capacity, file); @@ -77,7 +74,6 @@ void _sal_proc_save_into(FILE *file) fwrite(&g_capacity, sizeof(uint32), 1, file); fwrite(&g_first, sizeof(uint32), 1, file); fwrite(&g_last, sizeof(uint32), 1, file); - fwrite(&g_instructions_executed, sizeof(uint32), 1, file); fwrite(g_procs, sizeof(Process), g_capacity, file); } @@ -87,7 +83,6 @@ UINT32_GETTER(proc, count) UINT32_GETTER(proc, capacity) UINT32_GETTER(proc, first) UINT32_GETTER(proc, last) -UINT32_GETTER(proc, instructions_executed) boolean sal_proc_is_free(uint32 proc_id) { @@ -1280,9 +1275,7 @@ static void proc_cycle(uint32 pidx) assert(g_is_init); assert(pidx < g_capacity); assert(!sal_proc_is_free(pidx)); - inst = sal_mem_get_inst(g_procs[pidx].ip); - g_instructions_executed++; switch (inst) { case JMPB: @@ -1357,7 +1350,6 @@ void _sal_proc_cycle(void) */ assert(g_is_init); assert(module_is_valid()); - g_instructions_executed = 0; /* Iterate through all organisms in the reaper queue. First organism to execute is the one pointed to by 'g_last' (the one on top of the queue). |