int V3_deinit_cpu_mapper() {
destroy_default_cpu_mapper();
- v3_free_htable(master_cpu_mapper_table, 1, 1);
+ // we must leave the keys and values unfreed
+ // since we have no idea whether they are heap or otherwise
+ // the user must have done appropriate unregisters before this
+ v3_free_htable(master_cpu_mapper_table, 0, 0);
return 0;
}
if (specified_cpu != NULL) {
core_idx = atoi(specified_cpu);
+ // unsigned comparison with 0
if (core_idx < 0) {
PrintError(vm, VCORE_NONE, "Target CPU out of bounds (%d) \n", core_idx);
}
}
- core->pcpu_id = core_idx;
- vcore_id--;
+ core->pcpu_id = core_idx;
+ vcore_id--;
}
- if (vcore_id >= 0) {
- v3_stop_vm(vm);
- return -1;
- }
+ // if (vcore_id >= 0) { // dead code...
+ //v3_stop_vm(vm);
+ //return -1;
+ //}
return 0;
}
static int destroy_default_cpu_mapper()
{
v3_unregister_cpu_mapper(default_mapper_impl.name);
+ // note - is not deleted since it's a global...
return 0;
}