use record DefCounts with cons_count, sel_count, mem_count and type_count, instead of separate arguments