| ... | @@ -77,12 +77,15 @@ pub fn ArrayHashMap( | ... | @@ -77,12 +77,15 @@ pub fn ArrayHashMap( |
| 77 | comptime Context: type, | 77 | comptime Context: type, |
| 78 | comptime store_hash: bool, | 78 | comptime store_hash: bool, |
| 79 | ) type { | 79 | ) type { |
| 80 | comptime std.hash_map.verifyContext(Context, K, K, u32, true); | | |
| 81 | return struct { | 80 | return struct { |
| 82 | unmanaged: Unmanaged, | 81 | unmanaged: Unmanaged, |
| 83 | allocator: Allocator, | 82 | allocator: Allocator, |
| 84 | ctx: Context, | 83 | ctx: Context, |
| 85 | | 84 | |
| | 85 | comptime { |
| | 86 | std.hash_map.verifyContext(Context, K, K, u32, true); |
| | 87 | } |
| | 88 | |
| 86 | /// The ArrayHashMapUnmanaged type using the same settings as this managed map. | 89 | /// The ArrayHashMapUnmanaged type using the same settings as this managed map. |
| 87 | pub const Unmanaged = ArrayHashMapUnmanaged(K, V, Context, store_hash); | 90 | pub const Unmanaged = ArrayHashMapUnmanaged(K, V, Context, store_hash); |
| 88 | | 91 | |
| ... | @@ -470,7 +473,6 @@ pub fn ArrayHashMapUnmanaged( | ... | @@ -470,7 +473,6 @@ pub fn ArrayHashMapUnmanaged( |
| 470 | comptime Context: type, | 473 | comptime Context: type, |
| 471 | comptime store_hash: bool, | 474 | comptime store_hash: bool, |
| 472 | ) type { | 475 | ) type { |
| 473 | comptime std.hash_map.verifyContext(Context, K, K, u32, true); | | |
| 474 | return struct { | 476 | return struct { |
| 475 | /// It is permitted to access this field directly. | 477 | /// It is permitted to access this field directly. |
| 476 | entries: DataList = .{}, | 478 | entries: DataList = .{}, |
| ... | @@ -481,6 +483,10 @@ pub fn ArrayHashMapUnmanaged( | ... | @@ -481,6 +483,10 @@ pub fn ArrayHashMapUnmanaged( |
| 481 | /// by how many total indexes there are. | 483 | /// by how many total indexes there are. |
| 482 | index_header: ?*IndexHeader = null, | 484 | index_header: ?*IndexHeader = null, |
| 483 | | 485 | |
| | 486 | comptime { |
| | 487 | std.hash_map.verifyContext(Context, K, K, u32, true); |
| | 488 | } |
| | 489 | |
| 484 | /// Modifying the key is allowed only if it does not change the hash. | 490 | /// Modifying the key is allowed only if it does not change the hash. |
| 485 | /// Modifying the value is allowed. | 491 | /// Modifying the value is allowed. |
| 486 | /// Entry pointers become invalid whenever this ArrayHashMap is modified, | 492 | /// Entry pointers become invalid whenever this ArrayHashMap is modified, |