Skip to content

Commit

Permalink
Move Allocator patterns from std.heap to std.alloc
Browse files Browse the repository at this point in the history
Because allocations are such a core pattern within Zig, the various
Allocators deserve a clear namespace of their own. Additionally a number
of the various allocators may be misleading or confusing within the heap
name namespace, e.g. `FixedBufferAllocator` where most of the examples
and uses use stack based memory, and not heap.

Additionally moving the various Allocators from `std.heap` into
`std.alloc` also improves the stdlib namespace. Where
`std.heap.ArenaAllocator` is now `std.alloc.Arena`.
  • Loading branch information
GrayHatter committed Dec 19, 2024
1 parent 0ff0bdb commit 7226933
Show file tree
Hide file tree
Showing 15 changed files with 1,228 additions and 1,181 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,7 @@ set(ZIG_STAGE2_SOURCES
lib/std/Thread/Pool.zig
lib/std/Thread/ResetEvent.zig
lib/std/Thread/WaitGroup.zig
lib/std/alloc/arena.zig
lib/std/array_hash_map.zig
lib/std/array_list.zig
lib/std/ascii.zig
Expand Down Expand Up @@ -428,7 +429,6 @@ set(ZIG_STAGE2_SOURCES
lib/std/hash/wyhash.zig
lib/std/hash_map.zig
lib/std/heap.zig
lib/std/heap/arena_allocator.zig
lib/std/io.zig
lib/std/io/Reader.zig
lib/std/io/Writer.zig
Expand Down
Loading

0 comments on commit 7226933

Please sign in to comment.