authorgravatar for 68993177+godalming123@users.noreply.github.comgodalming123 <68993177+godalming123@users.noreply.github.com> 2025-03-25 06:19:28+00:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2025-03-25 06:19:28+00:00
log5bb4fef30a1b12fde3e3a20c2def301f7fd32fab
tree8781151bafc6b8e3ac88fa9b5b90024ebd7e5065
parent525466b49d4acc0d33f528bc9d53392c309a43bd
signaturebadge-check Signed by PGP key B5690EEEBB952194

Update the documentation comment in arena_allocator.zig to be more accurate

Update the documentation comment in arena_allocator.zig to specify that free() is a no-op unless the item is the most recent allocation.

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

lib/std/heap/arena_allocator.zig+4-2
...@@ -3,8 +3,10 @@ const assert = std.debug.assert;...@@ -3,8 +3,10 @@ const assert = std.debug.assert;
3const mem = std.mem;3const mem = std.mem;
4const Allocator = std.mem.Allocator;4const Allocator = std.mem.Allocator;
55
6/// This allocator takes an existing allocator, wraps it, and provides an interface6/// This allocator takes an existing allocator, wraps it, and provides an interface where
7/// where you can allocate without freeing, and then free it all together.7/// you can allocate and then free it all together. Calls to free an individual item only
8/// free the item if it was the most recent allocation, otherwise calls to free do
9/// nothing.
8pub const ArenaAllocator = struct {10pub const ArenaAllocator = struct {
9 child_allocator: Allocator,11 child_allocator: Allocator,
10 state: State,12 state: State,