repo.or.cz
/
dragonfly.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
kernel - Fix shared lock bug in kern_mutex.c
[dragonfly.git]
/
contrib
/
mdocml
/
test-ohash.c
blob
522ad708c075ece4be89f8769717077dc4ba3f70
1
#include <stdint.h>
2
#include <stddef.h>
3
#include <stdlib.h>
4
#include <ohash.h>
5
6
void
*
xmalloc
(
size_t
sz
,
void
*
arg
) {
return
(
calloc
(
1
,
sz
)); }
7
void
*
xcalloc
(
size_t
nmemb
,
size_t
sz
,
void
*
arg
) {
return
(
calloc
(
nmemb
,
sz
)); }
8
void
xfree
(
void
*
p
,
void
*
arg
) {
free
(
p
); }
9
10
int
11
main
(
void
)
12
{
13
struct
ohash h
;
14
struct
ohash_info i
;
15
i
.
alloc
=
xmalloc
;
16
i
.
calloc
=
xcalloc
;
17
i
.
free
=
xfree
;
18
ohash_init
(&
h
,
2
, &
i
);
19
ohash_delete
(&
h
);
20
return
0
;
21
}