From 746f6ea36d737e8bb5be067d5ac6492ada28311f Mon Sep 17 00:00:00 2001 From: Muhammad Zahalqa Date: Fri, 14 Aug 2020 16:28:13 +0300 Subject: [PATCH] Kernel: mark kmalloc with attributes --- Kernel/Heap/kmalloc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Kernel/Heap/kmalloc.h b/Kernel/Heap/kmalloc.h index ee6e68f8da..cf28535227 100644 --- a/Kernel/Heap/kmalloc.h +++ b/Kernel/Heap/kmalloc.h @@ -52,7 +52,7 @@ extern bool g_dump_kmalloc_stacks; inline void* operator new(size_t, void* p) { return p; } inline void* operator new[](size_t, void* p) { return p; } -ALWAYS_INLINE void* kmalloc(size_t size) +[[gnu::malloc, gnu::returns_nonnull, gnu::alloc_size(1)]] ALWAYS_INLINE void* kmalloc(size_t size) { #ifdef KMALLOC_DEBUG_LARGE_ALLOCATIONS // Any kernel allocation >= 1M is 99.9% a bug.