diff options
| author | gingerBill <bill@gingerbill.org> | 2023-04-20 11:46:23 +0100 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2023-04-20 11:46:41 +0100 |
| commit | 84f966cb8fd450f52e6bfdea2bb3c0645e2a77e8 (patch) | |
| tree | aad66c4b05af56fdc9964bc326bfcb3f6ecf8c41 /core/runtime | |
| parent | b2b88f1d99c497f152485869b3f155b965e813bc (diff) | |
Begin work on separating int and word sizes (i.e. `size_of(int)` might not equal `size_of(uintptr)`)
Diffstat (limited to 'core/runtime')
| -rw-r--r-- | core/runtime/core.odin | 2 | ||||
| -rw-r--r-- | core/runtime/dynamic_map_internal.odin | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/core/runtime/core.odin b/core/runtime/core.odin index 9939bfc5c..4a3b6dcdb 100644 --- a/core/runtime/core.odin +++ b/core/runtime/core.odin @@ -425,7 +425,7 @@ Raw_Map :: struct { // Map_Hash directly, though for consistency sake it's written as if it were // an array of Map_Cell(Map_Hash). data: uintptr, // 8-bytes on 64-bits, 4-bytes on 32-bits - len: int, // 8-bytes on 64-bits, 4-bytes on 32-bits + len: uintptr, // 8-bytes on 64-bits, 4-bytes on 32-bits allocator: Allocator, // 16-bytes on 64-bits, 8-bytes on 32-bits } diff --git a/core/runtime/dynamic_map_internal.odin b/core/runtime/dynamic_map_internal.odin index fb4ad29a9..dc1f15250 100644 --- a/core/runtime/dynamic_map_internal.odin +++ b/core/runtime/dynamic_map_internal.odin @@ -184,7 +184,7 @@ map_cell_index_static :: #force_inline proc "contextless" (cells: [^]Map_Cell($T // len() for map @(require_results) map_len :: #force_inline proc "contextless" (m: Raw_Map) -> int { - return m.len + return int(m.len) } // cap() for map @@ -207,8 +207,8 @@ map_load_factor :: #force_inline proc "contextless" (log2_capacity: uintptr) -> } @(require_results) -map_resize_threshold :: #force_inline proc "contextless" (m: Raw_Map) -> int { - return int(map_load_factor(map_log2_cap(m))) +map_resize_threshold :: #force_inline proc "contextless" (m: Raw_Map) -> uintptr { + return map_load_factor(map_log2_cap(m)) } // The data stores the log2 capacity in the lower six bits. This is primarily |