1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 19:37:35 +00:00

Kernel: mark kmalloc with attributes

This commit is contained in:
Muhammad Zahalqa 2020-08-14 16:28:13 +03:00 committed by Andreas Kling
parent bbe2d4a2d9
commit 746f6ea36d

View file

@ -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.