authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-04-09 17:37:35-04:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-04-09 17:43:49-04:00
logdea1027f9799e6ce0f7f2594c6b555d9675c281a
tree3e82871986ed06959910e90904b5b2a40600c7d8
parentcca02a4cf8fc59a221abd41d26bb2f1e03a869ee
signaturelock-open Commit is signed but in an unrecognized format.

doc comments for parameters in std.mem.Allocator


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

std/mem.zig+21-21
......@@ -34,39 +34,39 @@ pub const Allocator = struct {
3434 /// The returned slice must have its pointer aligned at least to `new_alignment` bytes.
3535 reallocFn: fn (
3636 self: *Allocator,
37 // Guaranteed to be the same as what was returned from most recent call to
38 // `reallocFn` or `shrinkFn`.
39 // If `old_mem.len == 0` then this is a new allocation and `new_byte_count`
40 // is guaranteed to be >= 1.
37 /// Guaranteed to be the same as what was returned from most recent call to
38 /// `reallocFn` or `shrinkFn`.
39 /// If `old_mem.len == 0` then this is a new allocation and `new_byte_count`
40 /// is guaranteed to be >= 1.
4141 old_mem: []u8,
42 // If `old_mem.len == 0` then this is `undefined`, otherwise:
43 // Guaranteed to be the same as what was returned from most recent call to
44 // `reallocFn` or `shrinkFn`.
45 // Guaranteed to be >= 1.
46 // Guaranteed to be a power of 2.
42 /// If `old_mem.len == 0` then this is `undefined`, otherwise:
43 /// Guaranteed to be the same as what was returned from most recent call to
44 /// `reallocFn` or `shrinkFn`.
45 /// Guaranteed to be >= 1.
46 /// Guaranteed to be a power of 2.
4747 old_alignment: u29,
48 // If `new_byte_count` is 0 then this is a free and it is guaranteed that
49 // `old_mem.len != 0`.
48 /// If `new_byte_count` is 0 then this is a free and it is guaranteed that
49 /// `old_mem.len != 0`.
5050 new_byte_count: usize,
51 // Guaranteed to be >= 1.
52 // Guaranteed to be a power of 2.
53 // Returned slice's pointer must have this alignment.
51 /// Guaranteed to be >= 1.
52 /// Guaranteed to be a power of 2.
53 /// Returned slice's pointer must have this alignment.
5454 new_alignment: u29,
5555 ) Error![]u8,
5656
5757 /// This function deallocates memory. It must succeed.
5858 shrinkFn: fn (
5959 self: *Allocator,
60 // Guaranteed to be the same as what was returned from most recent call to
61 // `reallocFn` or `shrinkFn`.
60 /// Guaranteed to be the same as what was returned from most recent call to
61 /// `reallocFn` or `shrinkFn`.
6262 old_mem: []u8,
63 // Guaranteed to be the same as what was returned from most recent call to
64 // `reallocFn` or `shrinkFn`.
63 /// Guaranteed to be the same as what was returned from most recent call to
64 /// `reallocFn` or `shrinkFn`.
6565 old_alignment: u29,
66 // Guaranteed to be less than or equal to `old_mem.len`.
66 /// Guaranteed to be less than or equal to `old_mem.len`.
6767 new_byte_count: usize,
68 // If `new_byte_count == 0` then this is `undefined`, otherwise:
69 // Guaranteed to be less than or equal to `old_alignment`.
68 /// If `new_byte_count == 0` then this is `undefined`, otherwise:
69 /// Guaranteed to be less than or equal to `old_alignment`.
7070 new_alignment: u29,
7171 ) []u8,
7272