runtime: fix map len and chan len/cap

This commit is contained in:
visualfc
2024-09-25 20:51:58 +08:00
parent 32f41a04ac
commit c184dc8d2f
7 changed files with 487 additions and 161 deletions

View File

@@ -82,3 +82,10 @@ func MapIterNext(it *hiter) (ok bool, k unsafe.Pointer, v unsafe.Pointer) {
mapiternext(it)
return
}
func MapLen(h *Map) int {
if h == nil {
return 0
}
return h.count
}