From 20215a376c56edfe460b1e5e35a2377af769eac5 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Wed, 27 Nov 2024 14:08:57 -0800 Subject: [PATCH] prepare to remove the "Managed" variant of std.ArrayHashMap --- lib/std/array_hash_map.zig | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/std/array_hash_map.zig b/lib/std/array_hash_map.zig index cc1d011b12..76667d069b 100644 --- a/lib/std/array_hash_map.zig +++ b/lib/std/array_hash_map.zig @@ -53,6 +53,14 @@ pub fn hashString(s: []const u8) u32 { return @as(u32, @truncate(std.hash.Wyhash.hash(0, s))); } +/// Deprecated in favor of `ArrayHashMapWithAllocator` (no code changes needed) +/// or `ArrayHashMapUnmanaged` (will need to update callsites to pass an +/// allocator). After Zig 0.14.0 is released, `ArrayHashMapWithAllocator` will +/// be removed and `ArrayHashMapUnmanaged` will be a deprecated alias. After +/// Zig 0.15.0 is released, the deprecated alias `ArrayHashMapUnmanaged` will +/// be removed. +pub const ArrayHashMap = ArrayHashMapWithAllocator; + /// A hash table of keys and values, each stored sequentially. /// /// Insertion order is preserved. In general, this data structure supports the same @@ -67,7 +75,7 @@ pub fn hashString(s: []const u8) u32 { /// /// See `ArrayHashMapUnmanaged` for a variant of this data structure that accepts an /// `Allocator` as a parameter when needed rather than storing it. -pub fn ArrayHashMap( +pub fn ArrayHashMapWithAllocator( comptime K: type, comptime V: type, /// A namespace that provides these two functions: