doc/config: do a better job of introducing 'worktree.guessRemote'
[gitweb.git] / khash.h
diff --git a/khash.h b/khash.h
index 07b4cc2e6714598ef920dcf28b8f73ba34979677..d10caa0c35095c9e37a5b4eab37415bc59491273 100644 (file)
--- a/khash.h
+++ b/khash.h
@@ -82,11 +82,16 @@ static const double __ac_HASH_UPPER = 0.77;
        SCOPE kh_##name##_t *kh_init_##name(void) {                                                     \
                return (kh_##name##_t*)xcalloc(1, sizeof(kh_##name##_t));               \
        }                                                                                                                                       \
+       SCOPE void kh_release_##name(kh_##name##_t *h)                                          \
+       {                                                                                                                                       \
+               free(h->flags);                                                                                                 \
+               free((void *)h->keys);                                                                                  \
+               free((void *)h->vals);                                                                                  \
+       }                                                                                                                                       \
        SCOPE void kh_destroy_##name(kh_##name##_t *h)                                          \
        {                                                                                                                                       \
                if (h) {                                                                                                                \
-                       free((void *)h->keys); free(h->flags);                                  \
-                       free((void *)h->vals);                                                                          \
+                       kh_release_##name(h);                                                                           \
                        free(h);                                                                                                        \
                }                                                                                                                               \
        }                                                                                                                                       \