Skip to content

Commit

Permalink
docs: clarify mem.Allocator.reallocFn
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewrk committed Jul 14, 2018
1 parent 5f1aa35 commit 317ed57
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion std/mem.zig
Expand Up @@ -23,7 +23,10 @@ pub const Allocator = struct {
/// * this function must return successfully.
/// * alignment <= alignment of old_mem.ptr
///
/// The returned newly allocated memory is undefined.
/// When `reallocFn` returns,
/// `return_value[0..min(old_mem.len, new_byte_count)]` must be the same
/// as `old_mem` was when `reallocFn` is called. The bytes of
/// `return_value[old_mem.len..]` have undefined values.
/// `alignment` is guaranteed to be >= 1
/// `alignment` is guaranteed to be a power of 2
reallocFn: fn (self: *Allocator, old_mem: []u8, new_byte_count: usize, alignment: u29) Error![]u8,
Expand Down

0 comments on commit 317ed57

Please sign in to comment.