Reimplemented reg_t_hashmap using Common::HashMap

svn-id: r38340
This commit is contained in:
Max Horn 2009-02-16 01:58:30 +00:00
parent 6098cadde3
commit 6af056c89d
7 changed files with 80 additions and 166 deletions

View file

@ -34,7 +34,6 @@
#include "sci/engine/kernel_types.h"
#include "sci/include/sci_midi.h"
#include "sci/include/sci_widgets.h"
#include "sci/include/reg_t_hashmap.h"
#include "common/util.h"
@ -3278,19 +3277,16 @@ c_gc(state_t *s) {
return 0;
}
static void
print_all_of_them(void *_1, reg_t reg, int _2) {
sciprintf(" - "PREG"\n", PRINT_REG(reg));
}
static int
c_gc_list_reachable(state_t *s) {
reg_t_hash_map_ptr use_map = find_all_used_references(s);
reg_t_hash_map *use_map = find_all_used_references(s);
sciprintf("Reachable references (normalised):\n");
apply_to_reg_t_hash_map(use_map, NULL, print_all_of_them);
for (reg_t_hash_map::iterator i = use_map->begin(); i != use_map->end(); ++i) {
sciprintf(" - "PREG"\n", PRINT_REG(i->_key));
}
free_reg_t_hash_map(use_map);
delete use_map;
return 0;
}