1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 18:57:45 +00:00

LibC: Add mmap_with_name() that names the allocation immediately.

This allows us to skip the separate call to set_mmap_name() in code that
we control, e.g malloc() and GraphicsBitmap.
This commit is contained in:
Andreas Kling 2019-05-19 15:54:56 +02:00
parent 5f26f83451
commit 189b342e6f
8 changed files with 28 additions and 13 deletions

View file

@ -32,8 +32,7 @@ void setpwent()
perror("open /etc/passwd");
}
assert(__pwdb_stream);
__pwdb_entry = (struct passwd_with_strings*)mmap(nullptr, getpagesize(), PROT_READ | PROT_WRITE, MAP_ANONYMOUS | MAP_PRIVATE, 0, 0);
set_mmap_name(__pwdb_entry, getpagesize(), "setpwent");
__pwdb_entry = (struct passwd_with_strings*)mmap_with_name(nullptr, getpagesize(), PROT_READ | PROT_WRITE, MAP_ANONYMOUS | MAP_PRIVATE, 0, 0, "setpwent");
}
}