mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-23 09:51:57 -05: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:
parent
1208fc7d37
commit
38c8dc22cf
4 changed files with 2 additions and 19 deletions
|
@ -150,10 +150,6 @@
|
|||
#cmakedefine01 KEYBOARD_DEBUG
|
||||
#endif
|
||||
|
||||
#ifndef KMALLOC_DEBUG
|
||||
#cmakedefine01 KMALLOC_DEBUG
|
||||
#endif
|
||||
|
||||
#ifndef LOCAL_SOCKET_DEBUG
|
||||
#cmakedefine01 LOCAL_SOCKET_DEBUG
|
||||
#endif
|
||||
|
@ -317,7 +313,3 @@
|
|||
#ifndef WAITQUEUE_DEBUG
|
||||
#cmakedefine01 WAITQUEUE_DEBUG
|
||||
#endif
|
||||
|
||||
#ifndef KMALLOC_DEBUG_LARGE_ALLOCATIONS
|
||||
#cmakedefine01 KMALLOC_DEBUG_LARGE_ALLOCATIONS
|
||||
#endif
|
||||
|
|
|
@ -236,7 +236,7 @@ void* kmalloc_eternal(size_t size)
|
|||
return ptr;
|
||||
}
|
||||
|
||||
void* kmalloc_impl(size_t size)
|
||||
void* kmalloc(size_t size)
|
||||
{
|
||||
ScopedSpinLock lock(s_lock);
|
||||
++g_kmalloc_call_count;
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -134,7 +134,6 @@ set(ICO_DEBUG ON)
|
|||
set(IPV4_DEBUG ON)
|
||||
set(IRC_DEBUG ON)
|
||||
set(KEYBOARD_DEBUG ON)
|
||||
set(KMALLOC_DEBUG_LARGE_ALLOCATIONS ON)
|
||||
set(LEXER_DEBUG ON)
|
||||
set(LOOKUPSERVER_DEBUG ON)
|
||||
set(MALLOC_DEBUG ON)
|
||||
|
|
Loading…
Add table
Reference in a new issue