Searched hist:"208 d02fd5d165389aed0c2b60519cb6b0f5b89f9" (Results 1 – 1 of 1) sorted by relevance
/freebsd/sys/compat/linuxkpi/common/include/linux/ |
H A D | slab.h | diff 208d02fd5d165389aed0c2b60519cb6b0f5b89f9 Fri Nov 11 21:03:25 CET 2022 Jean-Sébastien Pédron <dumbbell@FreeBSD.org> linuxkpi: Define `ZERO_OR_NULL_PTR()` in <linux/slab.h>
On Linux, the `kmalloc()` family of functions returns a special value if the size of the allocation is zero. This macro verifies if the pointer is NULL (the allocation failed) or the size is 0 (the allocation was not performed AFAIU). This special value can be passed to `kfree()`.
On FreeBSD, our `malloc(9)` functions don't return a special value for 0-size allocations. Therefore we can simply compare the result against NULL.
Reviewed by: manu Approved by: manu Differential Revision: https://reviews.freebsd.org/D37367
|