zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit 9bb7ff68ccab8700cb787a83359df02a5bb4370f (tree)
parent e04ab39036ebbae02e3f3007ffc9f1bd6d44c7a3
Author: Silver <silver@silv.re>
Date:   Sun,  7 Nov 2021 10:53:35 +0000

std: Publicize Allocator.reallocBytes

This is useful when dealing with runtime-known alignments, eg. interfacing
with C code that accepts custom allocation callbacks.

Closes #9394

Diffstat:
Mlib/std/mem/Allocator.zig | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/std/mem/Allocator.zig b/lib/std/mem/Allocator.zig @@ -80,7 +80,7 @@ pub fn noResize( /// as `old_mem` was when `reallocFn` is called. The bytes of /// `return_value[old_mem.len..]` have undefined values. /// The returned slice must have its pointer aligned at least to `new_alignment` bytes. -fn reallocBytes( +pub fn reallocBytes( self: *Allocator, /// Guaranteed to be the same as what was returned from most recent call to /// `allocFn` or `resizeFn`.