# std.heap.PageAllocator: hint mmaps in the same direction as stack growth · gitcafe/zig

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

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

Visibility: public

Requested revision: c8dd05030519fc52dd457531f6b2654e1ad129b2

Requested commit: c8dd05030519fc52dd457531f6b2654e1ad129b2

Commit: c8dd05030519fc52dd457531f6b2654e1ad129b2

Tree: 0dbb9592316d8d361bed029519b05f9acdc34ee7

Author: Alex Rønne Petersen

Committer: Alex Rønne Petersen

## Message

```
std.heap.PageAllocator: hint mmaps in the same direction as stack growth

The old logic was fine for targets where the stack grows up (so, literally just
hppa), but problematic on targets where it grows down, because we could hint
that we wanted an allocation to happen in an area of the address space that the
kernel expects to be able to expand the stack into. The kernel is happy to
satisfy such a hint despite the obvious problems this leads to later down the
road.

Co-authored-by: rpkak <rpkak@noreply.codeberg.org>

```

## Parents

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

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