summaryrefslogtreecommitdiff
path: root/Kernel/Process.cpp
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-09-22 19:47:00 +0200
committerAndreas Kling <awesomekling@gmail.com>2019-09-22 19:47:00 +0200
commitbba24b09f7fc49b41836711924df117d7a54b296 (patch)
treed898e63caa0fafeb4e4f3e115661730d2f85b826 /Kernel/Process.cpp
parent804df542960251e24be098e8ef52084e1faa3660 (diff)
downloadserenity-bba24b09f7fc49b41836711924df117d7a54b296.zip
Kernel: Avoid creating a temporary String("mmap") for every mmap() call
Diffstat (limited to 'Kernel/Process.cpp')
-rw-r--r--Kernel/Process.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/Kernel/Process.cpp b/Kernel/Process.cpp
index 679e092a3a..7f2d1f9645 100644
--- a/Kernel/Process.cpp
+++ b/Kernel/Process.cpp
@@ -208,13 +208,11 @@ void* Process::sys$mmap(const Syscall::SC_mmap_params* params)
if ((u32)addr & ~PAGE_MASK)
return (void*)-EINVAL;
if (flags & MAP_ANONYMOUS) {
- auto* region = allocate_region(VirtualAddress((u32)addr), size, "mmap", prot, false);
+ auto* region = allocate_region(VirtualAddress((u32)addr), size, name ? name : "mmap", prot, false);
if (!region)
return (void*)-ENOMEM;
if (flags & MAP_SHARED)
region->set_shared(true);
- if (name)
- region->set_name(name);
return region->vaddr().as_ptr();
}
if (offset & ~PAGE_MASK)