# \`std.mem.Allocator.create\` replaced with better API · gitcafe/zig

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

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

Visibility: public

Requested revision: dfbc063f79dc1358208216b466c1bf8c44baa430

Requested commit: dfbc063f79dc1358208216b466c1bf8c44baa430

Commit: dfbc063f79dc1358208216b466c1bf8c44baa430

Tree: 219c5f46a2e688fc1799117a1680102528691ce3

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
`std.mem.Allocator.create` replaced with better API

`std.mem.Allocator.createOne` is renamed to `std.mem.Allocator.create`.

The problem with the previous API is that even after copy elision,
the initalization value passed as a parameter would always be a copy.
With the new API, once copy elision is done, initialization
functions can directly initialize allocated memory in place.

Related:
 * #1872
 * #1873

```

## Parents

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

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