Changeset View
Changeset View
Standalone View
Standalone View
head/sys/contrib/zstd/lib/freebsd/zstd_kfreebsd.h
Show All 33 Lines | |||||
#endif | #endif | ||||
#ifdef _KERNEL | #ifdef _KERNEL | ||||
#include <sys/param.h> /* size_t */ | #include <sys/param.h> /* size_t */ | ||||
#include <sys/systm.h> /* memcpy, memset */ | #include <sys/systm.h> /* memcpy, memset */ | ||||
#ifndef BUILDING_ZFS | #ifndef BUILDING_ZFS | ||||
#include <sys/stddef.h> /* ptrdiff_t */ | #include <sys/stddef.h> /* ptrdiff_t */ | ||||
#endif | #endif | ||||
#include <sys/malloc.h> | |||||
MALLOC_DECLARE(M_ZSTD); | |||||
#define malloc(x) (malloc)((x), M_ZSTD, M_WAITOK) | |||||
#define free(x) (free)((x), M_ZSTD) | |||||
/* in zstd's use of calloc, a is always 1 */ | |||||
#define calloc(a,b) (mallocarray)((a), (b), M_ZSTD, M_WAITOK | M_ZERO) | |||||
#endif | #endif | ||||
#ifdef __cplusplus | #ifdef __cplusplus | ||||
} | } | ||||
#endif | #endif | ||||
#endif /* ZSTD_KFREEBSD_H */ | #endif /* ZSTD_KFREEBSD_H */ |