Kernel: Don't allocate memory for names of processes and threads

Instead, use the FixedCharBuffer class to ensure we always use a static
buffer storage for these names. This ensures that if a Process or a
Thread were created, there's a guarantee that setting a new name will
never fail, as only copying of strings should be done to that static
storage.

The limits which are set are 32 characters for processes' names and 64
characters for thread names - this is because threads' names could be
more verbose than processes' names.
This commit is contained in:
Liav A 2023-07-17 18:34:19 +03:00 committed by Andrew Kaster
parent 0d30f558f4
commit 3fd4997fc2
Notes: sideshowbarker 2024-07-17 06:00:02 +09:00
22 changed files with 102 additions and 110 deletions

View file

@ -14,7 +14,7 @@ namespace Kernel {
UNMAP_AFTER_INIT void SyncTask::spawn()
{
MUST(Process::create_kernel_process(KString::must_create("VFS Sync Task"sv), [] {
MUST(Process::create_kernel_process("VFS Sync Task"sv, [] {
dbgln("VFS SyncTask is running");
while (!Process::current().is_dying()) {
VirtualFileSystem::sync();