1 // SPDX-License-Identifier: GPL-2.0
6 #include <urcu/uatomic.h>
7 #include <linux/slab.h>
11 int kmalloc_nr_allocated;
14 void *kmalloc(size_t size, gfp_t gfp)
18 if (!(gfp & __GFP_DIRECT_RECLAIM))
22 uatomic_inc(&kmalloc_nr_allocated);
24 printf("Allocating %p from malloc\n", ret);
34 uatomic_dec(&kmalloc_nr_allocated);
36 printf("Freeing %p to malloc\n", p);