authorgravatar for silver@silv.reSilver <silver@silv.re> 2021-11-07 10:53:35+00:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-11-09 13:41:38-05:00
log9bb7ff68ccab8700cb787a83359df02a5bb4370f
treea6671ffc386f8cabe1e0cb1280e932514ec35228
parente04ab39036ebbae02e3f3007ffc9f1bd6d44c7a3

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

1 files changed, 1 insertions(+), 1 deletions(-)

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