mirror of
https://github.com/SerenityOS/serenity
synced 2024-09-06 17:06:31 +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:
parent
1208fc7d37
commit
38c8dc22cf
|
@ -150,10 +150,6 @@
|
||||||
#cmakedefine01 KEYBOARD_DEBUG
|
#cmakedefine01 KEYBOARD_DEBUG
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef KMALLOC_DEBUG
|
|
||||||
#cmakedefine01 KMALLOC_DEBUG
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef LOCAL_SOCKET_DEBUG
|
#ifndef LOCAL_SOCKET_DEBUG
|
||||||
#cmakedefine01 LOCAL_SOCKET_DEBUG
|
#cmakedefine01 LOCAL_SOCKET_DEBUG
|
||||||
#endif
|
#endif
|
||||||
|
@ -317,7 +313,3 @@
|
||||||
#ifndef WAITQUEUE_DEBUG
|
#ifndef WAITQUEUE_DEBUG
|
||||||
#cmakedefine01 WAITQUEUE_DEBUG
|
#cmakedefine01 WAITQUEUE_DEBUG
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef KMALLOC_DEBUG_LARGE_ALLOCATIONS
|
|
||||||
#cmakedefine01 KMALLOC_DEBUG_LARGE_ALLOCATIONS
|
|
||||||
#endif
|
|
||||||
|
|
|
@ -236,7 +236,7 @@ void* kmalloc_eternal(size_t size)
|
||||||
return ptr;
|
return ptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void* kmalloc_impl(size_t size)
|
void* kmalloc(size_t size)
|
||||||
{
|
{
|
||||||
ScopedSpinLock lock(s_lock);
|
ScopedSpinLock lock(s_lock);
|
||||||
++g_kmalloc_call_count;
|
++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; }
|
||||||
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)
|
[[gnu::malloc, gnu::returns_nonnull, gnu::alloc_size(1)]] void* kmalloc(size_t);
|
||||||
{
|
|
||||||
#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);
|
|
||||||
}
|
|
||||||
|
|
||||||
template<size_t ALIGNMENT>
|
template<size_t ALIGNMENT>
|
||||||
[[gnu::malloc, gnu::returns_nonnull, gnu::alloc_size(1)]] inline void* kmalloc_aligned(size_t size)
|
[[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(IPV4_DEBUG ON)
|
||||||
set(IRC_DEBUG ON)
|
set(IRC_DEBUG ON)
|
||||||
set(KEYBOARD_DEBUG ON)
|
set(KEYBOARD_DEBUG ON)
|
||||||
set(KMALLOC_DEBUG_LARGE_ALLOCATIONS ON)
|
|
||||||
set(LEXER_DEBUG ON)
|
set(LEXER_DEBUG ON)
|
||||||
set(LOOKUPSERVER_DEBUG ON)
|
set(LOOKUPSERVER_DEBUG ON)
|
||||||
set(MALLOC_DEBUG ON)
|
set(MALLOC_DEBUG ON)
|
||||||
|
|
Loading…
Reference in a new issue