# Add memory replacement routines · gitcafe/zig

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

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

Visibility: public

Requested revision: f050150ffaef7bc5e72e23c48d46617f640117e2

Requested commit: f050150ffaef7bc5e72e23c48d46617f640117e2

Commit: f050150ffaef7bc5e72e23c48d46617f640117e2

Tree: bb5f1afd709a45f418624e928dfb3f6823f5ed93

Author: meme

Committer: Andrew Kelley

## Message

```
Add memory replacement routines

* Added `replace` for simple pre-allocated search-and-replace
* Added `replacementSize` for calculating ahead-of-time buffer sizes for
performing a safe search-and-replace
* Added `replaceOwned` for automatically allocating and performing
replacement

```

## Parents

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

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