# std.heap.DirectAllocator: reduce the amount of redundant memcpy calls on Windows · gitcafe/zig

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

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

Visibility: public

Requested revision: 57f545eed8e940520855c127245414db9ea29310

Requested commit: 57f545eed8e940520855c127245414db9ea29310

Commit: 57f545eed8e940520855c127245414db9ea29310

Tree: 6249362202402aad3ad4707fc7d237cbbd27f090

Author: Ryan Liptak

Committer: Ryan Liptak

## Message

```
std.heap.DirectAllocator: reduce the amount of redundant memcpy calls on Windows

Previously the memory would be copied to a different aligned address in some cases where the old offset could have been used. This fixes it so that it will always try to use the old offset when possible, and only uses a different offset if the old one is truly invalid (not aligned or not enough space to store the alloc at the old offset).

```

## Parents

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

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