runtime: map

This commit is contained in:
xushiwei
2024-06-13 22:58:04 +08:00
parent 419133d3e1
commit 7a54967bee
16 changed files with 3057 additions and 102 deletions

View File

@@ -16,6 +16,12 @@
package runtime
import (
"unsafe"
"github.com/goplus/llgo/internal/abi"
)
// Map represents a Go map.
type Map = hmap
@@ -23,3 +29,8 @@ type Map = hmap
func MakeSmallMap() *Map {
return makemap_small()
}
// Mapassign finds a key in map m and returns the elem address to assign.
func Mapassign(t *abi.MapType, m *Map, key unsafe.Pointer) unsafe.Pointer {
return mapassign(t, m, key)
}