authorgravatar for 68993177+godalming123@users.noreply.github.comgodalming123 <68993177+godalming123@users.noreply.github.com> 2025-03-25 06:19:28+00:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-03-25 15:24:20+01:00
log0367d46d3c023122cd00f709e04b6194f977c5ef
treec315a35dcb064224083b82aaf5c74e7b83ed1d70
parentd67bf8bde39fae7ccc23a6ab3aacc3136ffb6b61
signaturebadge-check Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM

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;
33const mem = std.mem;
44const Allocator = std.mem.Allocator;
55
6/// This allocator takes an existing allocator, wraps it, and provides an interface
7/// where you can allocate without freeing, and then free it all together.
6/// This allocator takes an existing allocator, wraps it, and provides an interface where
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.
810pub const ArenaAllocator = struct {
911 child_allocator: Allocator,
1012 state: State,