diff options
Diffstat (limited to 'src/map.c')
-rw-r--r-- | src/map.c | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -13,7 +13,7 @@ static struct hashmap *all_terms; static void hashmap_free_term(void *item) { struct term *term = *(struct term **)item; - term_destroy_head(term); + term_destroy_head(term, 1); } struct hashmap *map_all_terms(void) @@ -51,14 +51,19 @@ void map_destroy(struct hashmap *map) hashmap_free(map); } -void map_dump(struct hashmap *map) +void map_dump(struct hashmap *map, char all) { fprintf(stderr, "\n---\nMap dump:\n"); + fprintf(stderr, "type\trefs\thash\t\t\tterm\t\tparents\n"); size_t iter = 0; void *iter_val; while (hashmap_iter(map, &iter, &iter_val)) { struct term *term = *(struct term **)iter_val; - fprintf(stderr, "%d\t%ld\t", term->type, term->refs); + /* if (!all && !term->is_program) */ + /* continue; */ + + fprintf(stderr, "%d\t%ld\t%lx\t", term->type, term->refs, + term->hash); term_print(term); fprintf(stderr, "\t{"); |