slab.h 692 B

123456789101112131415161718192021222324252627
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef SLAB_H
  3. #define SLAB_H
  4. #include <linux/types.h>
  5. #include <linux/gfp.h>
  6. #define SLAB_HWCACHE_ALIGN 1
  7. #define SLAB_PANIC 2
  8. #define SLAB_RECLAIM_ACCOUNT 0x00020000UL /* Objects are reclaimable */
  9. void *kmalloc(size_t size, gfp_t);
  10. void kfree(void *);
  11. static inline void *kzalloc(size_t size, gfp_t gfp)
  12. {
  13. return kmalloc(size, gfp | __GFP_ZERO);
  14. }
  15. void *kmem_cache_alloc(struct kmem_cache *cachep, int flags);
  16. void kmem_cache_free(struct kmem_cache *cachep, void *objp);
  17. struct kmem_cache *
  18. kmem_cache_create(const char *name, size_t size, size_t offset,
  19. unsigned long flags, void (*ctor)(void *));
  20. #endif /* SLAB_H */