Print process name and PID when kmalloc() panics.

This commit is contained in:
Andreas Kling 2019-01-12 21:48:41 +01:00
parent edc827077e
commit 2e2d883c09
Notes: sideshowbarker 2024-07-19 16:03:32 +09:00

View file

@ -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;