| ... | @@ -370,12 +370,15 @@ pub fn HashMap( | ... | @@ -370,12 +370,15 @@ pub fn HashMap( |
| 370 | comptime Context: type, | 370 | comptime Context: type, |
| 371 | comptime max_load_percentage: u64, | 371 | comptime max_load_percentage: u64, |
| 372 | ) type { | 372 | ) type { |
| 373 | comptime verifyContext(Context, K, K, u64, false); | | |
| 374 | return struct { | 373 | return struct { |
| 375 | unmanaged: Unmanaged, | 374 | unmanaged: Unmanaged, |
| 376 | allocator: Allocator, | 375 | allocator: Allocator, |
| 377 | ctx: Context, | 376 | ctx: Context, |
| 378 | | 377 | |
| | 378 | comptime { |
| | 379 | verifyContext(Context, K, K, u64, false); |
| | 380 | } |
| | 381 | |
| 379 | /// The type of the unmanaged hash map underlying this wrapper | 382 | /// The type of the unmanaged hash map underlying this wrapper |
| 380 | pub const Unmanaged = HashMapUnmanaged(K, V, Context, max_load_percentage); | 383 | pub const Unmanaged = HashMapUnmanaged(K, V, Context, max_load_percentage); |
| 381 | /// An entry, containing pointers to a key and value stored in the map | 384 | /// An entry, containing pointers to a key and value stored in the map |
| ... | @@ -694,11 +697,13 @@ pub fn HashMapUnmanaged( | ... | @@ -694,11 +697,13 @@ pub fn HashMapUnmanaged( |
| 694 | ) type { | 697 | ) type { |
| 695 | if (max_load_percentage <= 0 or max_load_percentage >= 100) | 698 | if (max_load_percentage <= 0 or max_load_percentage >= 100) |
| 696 | @compileError("max_load_percentage must be between 0 and 100."); | 699 | @compileError("max_load_percentage must be between 0 and 100."); |
| 697 | comptime verifyContext(Context, K, K, u64, false); | | |
| 698 | | | |
| 699 | return struct { | 700 | return struct { |
| 700 | const Self = @This(); | 701 | const Self = @This(); |
| 701 | | 702 | |
| | 703 | comptime { |
| | 704 | verifyContext(Context, K, K, u64, false); |
| | 705 | } |
| | 706 | |
| 702 | // This is actually a midway pointer to the single buffer containing | 707 | // This is actually a midway pointer to the single buffer containing |
| 703 | // a `Header` field, the `Metadata`s and `Entry`s. | 708 | // a `Header` field, the `Metadata`s and `Entry`s. |
| 704 | // At `-@sizeOf(Header)` is the Header field. | 709 | // At `-@sizeOf(Header)` is the Header field. |