extern uint64_t spl_kmem_cache_inuse(kmem_cache_t *cache);
extern uint64_t spl_kmem_cache_entry_size(kmem_cache_t *cache);
-__attribute__((alloc_size(1)))
+__attribute__((malloc, alloc_size(1)))
void *zfs_kmem_alloc(size_t size, int kmflags);
void zfs_kmem_free(void *buf, size_t size);
uint64_t kmem_size(void);
int (*constructor)(void *, void *, int), void (*destructor)(void *, void *),
void (*reclaim)(void *) __unused, void *private, vmem_t *vmp, int cflags);
void kmem_cache_destroy(kmem_cache_t *cache);
+__attribute__((malloc))
void *kmem_cache_alloc(kmem_cache_t *cache, int flags);
void kmem_cache_free(kmem_cache_t *cache, void *buf);
boolean_t kmem_cache_reap_active(void);
#include <linux/vmalloc.h>
extern int kmem_debugging(void);
-extern char *kmem_vasprintf(const char *fmt, va_list ap)
- __attribute__((format(printf, 1, 0)));
-extern char *kmem_asprintf(const char *fmt, ...)
- __attribute__((format(printf, 1, 2)));
+__attribute__((format(printf, 1, 0)))
+extern char *kmem_vasprintf(const char *fmt, va_list ap);
+__attribute__((format(printf, 1, 2)))
+extern char *kmem_asprintf(const char *fmt, ...);
extern char *kmem_strdup(const char *str);
extern void kmem_strfree(char *str);
#define kmem_free(ptr, sz) spl_kmem_free((ptr), (sz))
#define kmem_cache_reap_active spl_kmem_cache_reap_active
-extern void *spl_kmem_alloc(size_t sz, int fl, const char *func, int line)
- __attribute__((alloc_size(1)));
-extern void *spl_kmem_zalloc(size_t sz, int fl, const char *func, int line)
- __attribute__((alloc_size(1)));
+__attribute__((malloc, alloc_size(1)))
+extern void *spl_kmem_alloc(size_t sz, int fl, const char *func, int line);
+__attribute__((malloc, alloc_size(1)))
+extern void *spl_kmem_zalloc(size_t sz, int fl, const char *func, int line);
extern void spl_kmem_free(const void *ptr, size_t sz);
/*
#define vmem_zalloc(sz, fl) spl_vmem_zalloc((sz), (fl), __func__, __LINE__)
#define vmem_free(ptr, sz) spl_vmem_free((ptr), (sz))
-extern void *spl_vmem_alloc(size_t sz, int fl, const char *func, int line);
-extern void *spl_vmem_zalloc(size_t sz, int fl, const char *func, int line);
+extern void *spl_vmem_alloc(size_t sz, int fl, const char *func, int line)
+ __attribute__((malloc, alloc_size(1)));
+extern void *spl_vmem_zalloc(size_t sz, int fl, const char *func, int line)
+ __attribute__((malloc, alloc_size(1)));
extern void spl_vmem_free(const void *ptr, size_t sz);
int spl_vmem_init(void);
* Allocations and deallocations
*/
+__attribute__((malloc))
abd_t *abd_alloc(size_t, boolean_t);
+__attribute__((malloc))
abd_t *abd_alloc_linear(size_t, boolean_t);
+__attribute__((malloc))
abd_t *abd_alloc_gang(void);
+__attribute__((malloc))
abd_t *abd_alloc_for_io(size_t, boolean_t);
+__attribute__((malloc))
abd_t *abd_alloc_sametype(abd_t *, size_t);
boolean_t abd_size_alloc_linear(size_t);
void abd_gang_add(abd_t *, abd_t *, boolean_t);
const char *_umem_options_init(void);
const char *_umem_logging_init(void);
-__attribute__((alloc_size(1)))
+__attribute__((malloc, alloc_size(1)))
static inline void *
umem_alloc(size_t size, int flags)
{
return (ptr);
}
-__attribute__((alloc_size(1)))
+__attribute__((malloc, alloc_size(1)))
static inline void *
umem_alloc_aligned(size_t size, size_t align, int flags)
{
return (ptr);
}
-__attribute__((alloc_size(1)))
+__attribute__((malloc, alloc_size(1)))
static inline void *
umem_zalloc(size_t size, int flags)
{
umem_free(cp, sizeof (umem_cache_t));
}
+__attribute__((malloc))
static inline void *
umem_cache_alloc(umem_cache_t *cp, int flags)
{