X-Git-Url: http://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=ccan%2Fhtable%2Fhtable.h;h=28755d617d67b7766d44fe3e5ce93d7956a85d55;hp=53c447c09b952b198913efa25a48b82d34777242;hb=7a353c03e5e8cdd55cbc0917f9ecff5cf9beefdb;hpb=6a8bb2092789b5b8cf9430bc188597074a17d995;ds=inline diff --git a/ccan/htable/htable.h b/ccan/htable/htable.h index 53c447c0..28755d61 100644 --- a/ccan/htable/htable.h +++ b/ccan/htable/htable.h @@ -259,4 +259,11 @@ void *htable_prev_(const struct htable *htable, struct htable_iter *i); htable_delval_(htable_debug(htable, HTABLE_LOC), i) void htable_delval_(struct htable *ht, struct htable_iter *i); +/** + * htable_set_allocator - set calloc/free functions. + * @alloc: allocator to use, must zero memory! + * @free: unallocator to use (@p is NULL or a return from @alloc) + */ +void htable_set_allocator(void *(*alloc)(struct htable *, size_t len), + void (*free)(struct htable *, void *p)); #endif /* CCAN_HTABLE_H */