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

Kernel: Remove unused KMALLOC_DEBUG_LARGE_ALLOCATIONS mode

This was a thing back when the system was so little that any kernel
allocation above 1 MiB was basically guaranteed to be a bug. :^)
This commit is contained in:
Andreas Kling 2021-03-04 11:13:17 +01:00
parent 1208fc7d37
commit 38c8dc22cf
4 changed files with 2 additions and 19 deletions

View file

@ -53,15 +53,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; }
[[gnu::malloc, gnu::returns_nonnull, gnu::alloc_size(1)]] ALWAYS_INLINE void* kmalloc(size_t size)
{
#if KMALLOC_DEBUG_LARGE_ALLOCATIONS
// Any kernel allocation >= 1M is 99.9% a bug.
if (size >= 1048576)
asm volatile("cli;hlt");
#endif
return kmalloc_impl(size);
}
[[gnu::malloc, gnu::returns_nonnull, gnu::alloc_size(1)]] void* kmalloc(size_t);
template<size_t ALIGNMENT>
[[gnu::malloc, gnu::returns_nonnull, gnu::alloc_size(1)]] inline void* kmalloc_aligned(size_t size)