# std.mem.Allocator: introduce \`remap\` function to the interface · gitcafe/zig

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

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

Visibility: public

Requested revision: 7eeef5fb2b9dc78679f4091e2a8173d07968b3e5

Requested commit: 7eeef5fb2b9dc78679f4091e2a8173d07968b3e5

Commit: 7eeef5fb2b9dc78679f4091e2a8173d07968b3e5

Tree: a5edee99fe9ea1e5c241ec0e7b21268d65a8ff8b

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
std.mem.Allocator: introduce `remap` function to the interface

This one changes the size of an allocation, allowing it to be relocated.
However, the implementation will still return `null` if it would be
equivalent to

new = alloc
memcpy(new, old)
free(old)

Mainly this prepares for taking advantage of `mremap` which I thought
would be a bigger deal but apparently is only available on Linux. Still,
we should use it on Linux.

```

## Parents

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

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