# std: Allocate tlscsprng memory as needed · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/b7eab32f42040ecb80501111adb05bc8369625e8)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: b7eab32f42040ecb80501111adb05bc8369625e8

Requested commit: b7eab32f42040ecb80501111adb05bc8369625e8

Commit: b7eab32f42040ecb80501111adb05bc8369625e8

Tree: 7fe250870ed8690ec8eb71bf1a5878debb6d47e5

Author: LemonBoy

Committer: Andrew Kelley

## Message

```
std: Allocate tlscsprng memory as needed

Let mmap allocate a block of memory that's wide enough to use with
MADV_WIPEONFORK, madvise granularity is the current system page size
(using a static buffer of mem.page_size bytes would be wrong, that's the
minimum page size).

As a result, we don't zero some random chunk of memory every time we
fork the process.

Fixes #7609

```

## Parents

- [fe1a166589db0f2371429c93e1e1e622c19378f1](https://git.cafe/gitcafe/zig/commit/fe1a166589db0f2371429c93e1e1e622c19378f1?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/b7eab32f42040ecb80501111adb05bc8369625e8?format=markdown)
