blob: 522ad708c075ece4be89f8769717077dc4ba3f70 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
#include <stdint.h>
#include <stddef.h>
#include <stdlib.h>
#include <ohash.h>
void *xmalloc(size_t sz, void *arg) { return(calloc(1,sz)); }
void *xcalloc(size_t nmemb, size_t sz, void *arg) { return(calloc(nmemb,sz)); }
void xfree(void *p, void *arg) { free(p); }
int
main(void)
{
struct ohash h;
struct ohash_info i;
i.alloc = xmalloc;
i.calloc = xcalloc;
i.free = xfree;
ohash_init(&h, 2, &i);
ohash_delete(&h);
return 0;
}
|