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
signature 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 {...@@ -34,39 +34,39 @@ pub const Allocator = struct {
34 /// The returned slice must have its pointer aligned at least to `new_alignment` bytes.34 /// The returned slice must have its pointer aligned at least to `new_alignment` bytes.
35 reallocFn: fn (35 reallocFn: fn (
36 self: *Allocator,36 self: *Allocator,
37 // Guaranteed to be the same as what was returned from most recent call to37 /// Guaranteed to be the same as what was returned from most recent call to
38 // `reallocFn` or `shrinkFn`.38 /// `reallocFn` or `shrinkFn`.
39 // If `old_mem.len == 0` then this is a new allocation and `new_byte_count`39 /// If `old_mem.len == 0` then this is a new allocation and `new_byte_count`
40 // is guaranteed to be >= 1.40 /// is guaranteed to be >= 1.
41 old_mem: []u8,41 old_mem: []u8,
42 // If `old_mem.len == 0` then this is `undefined`, otherwise: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 to43 /// Guaranteed to be the same as what was returned from most recent call to
44 // `reallocFn` or `shrinkFn`.44 /// `reallocFn` or `shrinkFn`.
45 // Guaranteed to be >= 1.45 /// Guaranteed to be >= 1.
46 // Guaranteed to be a power of 2.46 /// Guaranteed to be a power of 2.
47 old_alignment: u29,47 old_alignment: u29,
48 // If `new_byte_count` is 0 then this is a free and it is guaranteed that48 /// If `new_byte_count` is 0 then this is a free and it is guaranteed that
49 // `old_mem.len != 0`.49 /// `old_mem.len != 0`.
50 new_byte_count: usize,50 new_byte_count: usize,
51 // Guaranteed to be >= 1.51 /// Guaranteed to be >= 1.
52 // Guaranteed to be a power of 2.52 /// Guaranteed to be a power of 2.
53 // Returned slice's pointer must have this alignment.53 /// Returned slice's pointer must have this alignment.
54 new_alignment: u29,54 new_alignment: u29,
55 ) Error![]u8,55 ) Error![]u8,
5656
57 /// This function deallocates memory. It must succeed.57 /// This function deallocates memory. It must succeed.
58 shrinkFn: fn (58 shrinkFn: fn (
59 self: *Allocator,59 self: *Allocator,
60 // Guaranteed to be the same as what was returned from most recent call to60 /// Guaranteed to be the same as what was returned from most recent call to
61 // `reallocFn` or `shrinkFn`.61 /// `reallocFn` or `shrinkFn`.
62 old_mem: []u8,62 old_mem: []u8,
63 // Guaranteed to be the same as what was returned from most recent call to63 /// Guaranteed to be the same as what was returned from most recent call to
64 // `reallocFn` or `shrinkFn`.64 /// `reallocFn` or `shrinkFn`.
65 old_alignment: u29,65 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`.
67 new_byte_count: usize,67 new_byte_count: usize,
68 // If `new_byte_count == 0` then this is `undefined`, otherwise:68 /// If `new_byte_count == 0` then this is `undefined`, otherwise:
69 // Guaranteed to be less than or equal to `old_alignment`.69 /// Guaranteed to be less than or equal to `old_alignment`.
70 new_alignment: u29,70 new_alignment: u29,
71 ) []u8,71 ) []u8,
7272