# Improve realloc on fixed buffer allocator \(\#1238\) · gitcafe/zig

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

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

Visibility: public

Requested revision: 69e50ad2f54bc446b2258f464f9b09e78e132d45

Requested commit: 69e50ad2f54bc446b2258f464f9b09e78e132d45

Commit: 69e50ad2f54bc446b2258f464f9b09e78e132d45

Tree: f9861f568089370da238564cc54924bb2643fcd4

Author: Bas van den Berg

Committer: Andrew Kelley

## Message

```
Improve realloc on fixed buffer allocator (#1238)

* Add test to check re-use of memory

* Check if realloc has to reallocate the last allocated memory block.
If so extend that block instead of allocating a new one.

* Also check if the realloc actually preserves the data.

```

## Parents

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

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