X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;f=ccan%2Fhtable%2Fhtable_type.h;h=ad3974c5e446dc74be147371d74dafb09feea631;hb=64b0c5cdeea5bc00ce3b9ef89fd3aade9cb0cd2c;hp=03cc46fc5836c8003e2c1e325c13a5ec6df5db47;hpb=f45214bf85dd683a8268042b217e98444b4a2573;p=ccan diff --git a/ccan/htable/htable_type.h b/ccan/htable/htable_type.h index 03cc46fc..ad3974c5 100644 --- a/ccan/htable/htable_type.h +++ b/ccan/htable/htable_type.h @@ -20,6 +20,7 @@ * * It also defines initialization and freeing functions: * void _init(struct *); + * void _init_sized(struct *, size_t); * void _clear(struct *); * * Add function only fails if we run out of memory: @@ -53,6 +54,10 @@ { \ htable_init(&ht->raw, name##_hash, NULL); \ } \ + static inline void name##_init_sized(struct name *ht, size_t s) \ + { \ + htable_init_sized(&ht->raw, name##_hash, NULL, s); \ + } \ static inline void name##_clear(struct name *ht) \ { \ htable_clear(&ht->raw); \