summaryrefslogtreecommitdiff
path: root/sys/dev/zlib/zcalloc.c
blob: 3b81b369c609e79a65dfb1e77fb6d2917cc348ad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/*
 * This file is in the public domain.
 */

#include <sys/param.h>
#include <dev/zlib/zcalloc.h>
#include <sys/kernel.h>
#include <sys/malloc.h>

MALLOC_DEFINE(M_ZLIB, "zlib", "ZLIB Compressor");

void *
zcalloc_waitok(void *nil, u_int items, u_int size)
{

	return mallocarray(items, size, M_ZLIB, M_WAITOK);
}

void *
zcalloc_nowait(void *nil, u_int items, u_int size)
{

	return mallocarray(items, size, M_ZLIB, M_NOWAIT);
}

void *
zcalloc(void *nil, u_int items, u_int size)
{

	return zcalloc_nowait(nil, items, size);
}

void
zcfree(void *nil, void *ptr)
{

        free(ptr, M_ZLIB);
}