aboutsummaryrefslogtreecommitdiff
path: root/src/runtime
diff options
context:
space:
mode:
Diffstat (limited to 'src/runtime')
-rw-r--r--src/runtime/map.go5
-rw-r--r--src/runtime/mbarrier.go9
2 files changed, 14 insertions, 0 deletions
diff --git a/src/runtime/map.go b/src/runtime/map.go
index 6179c1e371..3f5817a577 100644
--- a/src/runtime/map.go
+++ b/src/runtime/map.go
@@ -1403,6 +1403,11 @@ func reflect_maplen(h *hmap) int {
return h.count
}
+//go:linkname reflect_mapclear reflect.mapclear
+func reflect_mapclear(t *maptype, h *hmap) {
+ mapclear(t, h)
+}
+
//go:linkname reflectlite_maplen internal/reflectlite.maplen
func reflectlite_maplen(h *hmap) int {
if h == nil {
diff --git a/src/runtime/mbarrier.go b/src/runtime/mbarrier.go
index 46ef42f74d..dbcd4db868 100644
--- a/src/runtime/mbarrier.go
+++ b/src/runtime/mbarrier.go
@@ -334,6 +334,15 @@ func reflect_typedmemclrpartial(typ *_type, ptr unsafe.Pointer, off, size uintpt
memclrNoHeapPointers(ptr, size)
}
+//go:linkname reflect_typedarrayclear reflect.typedarrayclear
+func reflect_typedarrayclear(typ *_type, ptr unsafe.Pointer, len int) {
+ size := typ.size * uintptr(len)
+ if writeBarrier.needed && typ.ptrdata != 0 {
+ bulkBarrierPreWrite(uintptr(ptr), 0, size)
+ }
+ memclrNoHeapPointers(ptr, size)
+}
+
// memclrHasPointers clears n bytes of typed memory starting at ptr.
// The caller must ensure that the type of the object at ptr has
// pointers, usually by checking typ.ptrdata. However, ptr