From 0733682e5ff4cd294f5eccb31cbe87a543147bc6 Mon Sep 17 00:00:00 2001 From: Michael Pratt Date: Mon, 22 Apr 2024 15:48:57 -0400 Subject: internal/runtime/maps: initial swiss table map implementation Add a new package that will contain a new "Swiss Table" (https://abseil.io/about/design/swisstables) map implementation, which is intended to eventually replace the existing runtime map implementation. This implementation is based on the fabulous github.com/cockroachdb/swiss package contributed by Peter Mattis. This CL adds an hash map implementation. It supports all the core operations, but does not have incremental growth. For #54766. Change-Id: I52cf371448c3817d471ddb1f5a78f3513565db41 Reviewed-on: https://go-review.googlesource.com/c/go/+/582415 Reviewed-by: Keith Randall Reviewed-by: Keith Randall Auto-Submit: Michael Pratt LUCI-TryBot-Result: Go LUCI Reviewed-by: Michael Knyszek --- src/runtime/malloc.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/runtime/malloc.go') diff --git a/src/runtime/malloc.go b/src/runtime/malloc.go index a35f806aa3..7076ced453 100644 --- a/src/runtime/malloc.go +++ b/src/runtime/malloc.go @@ -1450,6 +1450,11 @@ func reflect_unsafe_NewArray(typ *_type, n int) unsafe.Pointer { return newarray(typ, n) } +//go:linkname maps_newarray internal/runtime/maps.newarray +func maps_newarray(typ *_type, n int) unsafe.Pointer { + return newarray(typ, n) +} + func profilealloc(mp *m, x unsafe.Pointer, size uintptr) { c := getMCache(mp) if c == nil { -- cgit v1.3