+ size_t n_entries = hmap_count (hmap);
+ struct freq **entries;
+ struct freq *f;
+ size_t i;
+
+ entries = xnmalloc (n_entries, sizeof *entries);
+ i = 0;
+ HMAP_FOR_EACH (f, struct freq, hmap_node, hmap)
+ entries[i++] = f;
+ assert (i == n_entries);
+
+ sort (entries, n_entries, sizeof *entries, compare_freq_ptr_3way, &width);
+
+ return entries;