1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-12-08 10:01:01 +01:00

Remove C-style casts

This commit is contained in:
Jacek Galowicz 2023-11-02 15:52:38 +01:00
parent d11d7849f7
commit 9d9f42cc38
3 changed files with 17 additions and 7 deletions

View file

@ -226,8 +226,8 @@ pid_t startProcess(std::function<void()> fun, const ProcessOptions & options)
assert(!(options.cloneFlags & CLONE_VM));
size_t stackSize = 1 * 1024 * 1024;
auto stack = (char *) mmap(0, stackSize,
PROT_WRITE | PROT_READ, MAP_PRIVATE | MAP_ANONYMOUS | MAP_STACK, -1, 0);
auto stack = static_cast<char *>(mmap(0, stackSize,
PROT_WRITE | PROT_READ, MAP_PRIVATE | MAP_ANONYMOUS | MAP_STACK, -1, 0));
if (stack == MAP_FAILED) throw SysError("allocating stack");
Finally freeStack([&] { munmap(stack, stackSize); });