Skip to content

Commit

Permalink
Kernel: mark kmalloc with attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
tryfinally authored and awesomekling committed Aug 14, 2020
1 parent bbe2d4a commit 746f6ea
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Kernel/Heap/kmalloc.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 746f6ea

Please sign in to comment.