mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-23 04:55:15 +00:00
Print process name and PID when kmalloc() panics.
This commit is contained in:
parent
edc827077e
commit
2e2d883c09
Notes:
sideshowbarker
2024-07-19 16:03:32 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/2e2d883c09c
1 changed files with 4 additions and 2 deletions
|
@ -8,6 +8,8 @@
|
|||
#include "StdLib.h"
|
||||
#include "i386.h"
|
||||
#include "system.h"
|
||||
#include "Process.h"
|
||||
#include "Scheduler.h"
|
||||
#include <AK/Assertions.h>
|
||||
|
||||
#define SANITIZE_KMALLOC
|
||||
|
@ -100,7 +102,7 @@ void* kmalloc(dword size)
|
|||
real_size = size + sizeof(allocation_t);
|
||||
|
||||
if (sum_free < real_size) {
|
||||
kprintf("kmalloc(): PANIC! Out of memory (sucks, dude)\nsum_free=%u, real_size=%x\n", sum_free, real_size);
|
||||
kprintf("%s<%u> kmalloc(): PANIC! Out of memory (sucks, dude)\nsum_free=%u, real_size=%x\n", current->name().characters(), current->pid(), sum_free, real_size);
|
||||
HANG;
|
||||
return 0L;
|
||||
}
|
||||
|
@ -161,7 +163,7 @@ void* kmalloc(dword size)
|
|||
}
|
||||
}
|
||||
|
||||
kprintf("kmalloc(): PANIC! Out of memory (no suitable block for size %u)\n", size);
|
||||
kprintf("%s<%u> kmalloc(): PANIC! Out of memory (no suitable block for size %u)\n", current->name().characters(), current->pid(), size);
|
||||
HANG;
|
||||
|
||||
return nullptr;
|
||||
|
|
Loading…
Add table
Reference in a new issue