2019-08-01 06:35:33 +00:00
|
|
|
/*
|
|
|
|
* This file is in the public domain.
|
|
|
|
* $FreeBSD$
|
|
|
|
*/
|
|
|
|
|
|
|
|
#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);
|
|
|
|
}
|
|
|
|
|
2019-08-07 01:41:17 +00:00
|
|
|
void *
|
|
|
|
zcalloc(void *nil, u_int items, u_int size)
|
|
|
|
{
|
|
|
|
|
|
|
|
return zcalloc_nowait(nil, items, size);
|
|
|
|
}
|
|
|
|
|
2019-08-01 06:35:33 +00:00
|
|
|
void
|
|
|
|
zcfree(void *nil, void *ptr)
|
|
|
|
{
|
|
|
|
|
|
|
|
free(ptr, M_ZLIB);
|
|
|
|
}
|