Add reflect.default_map_hash_by_ptr

This commit is contained in:
gingerBill
2025-12-21 17:09:22 +00:00
parent 06076e02c0
commit 998da2c2da

View File

@@ -2003,4 +2003,14 @@ equal :: proc(a, b: any, including_indirect_array_recursion := false, recursion_
runtime.print_typeid(a.id)
runtime.print_string("\n")
return true
}
@(require_results)
default_map_hash_by_ptr :: proc(ptr: ^$T, seed: uintptr = runtime.INITIAL_HASH_SEED) -> uintptr where intrinsics.type_is_comparable(T) {
assert(ptr != nil)
info := intrinsics.type_map_info(map[T]struct{})
return info.key_hasher(ptr, seed)
}