aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/map.go
diff options
context:
space:
mode:
authorBrad Fitzpatrick <bradfitz@golang.org>2019-03-25 17:39:11 +0000
committerBrad Fitzpatrick <bradfitz@golang.org>2019-03-27 04:58:23 +0000
commit39a51a4b0d698491baaa252e21be2a51516379ea (patch)
treee14c5dce3e27e69783779ae5b81a0668a36ab5d7 /src/runtime/map.go
parentf0e0be6e9020caff0b44e0dcb44c8b2e707710f0 (diff)
downloadgo-39a51a4b0d698491baaa252e21be2a51516379ea.tar.gz
go-39a51a4b0d698491baaa252e21be2a51516379ea.zip
sort, internal/reflectlite: flesh out reflectlite enough for use by sort
Now the net package is back to no longer depending on unicode. And lock that in with a test. Fixes #30440 Change-Id: I18b89b02f7d96488783adc07308da990f505affd Reviewed-on: https://go-review.googlesource.com/c/go/+/169137 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'src/runtime/map.go')
-rw-r--r--src/runtime/map.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/runtime/map.go b/src/runtime/map.go
index 0ebbf2ae76..bb32526846 100644
--- a/src/runtime/map.go
+++ b/src/runtime/map.go
@@ -1371,6 +1371,18 @@ func reflect_maplen(h *hmap) int {
return h.count
}
+//go:linkname reflectlite_maplen internal/reflectlite.maplen
+func reflectlite_maplen(h *hmap) int {
+ if h == nil {
+ return 0
+ }
+ if raceenabled {
+ callerpc := getcallerpc()
+ racereadpc(unsafe.Pointer(h), callerpc, funcPC(reflect_maplen))
+ }
+ return h.count
+}
+
//go:linkname reflect_ismapkey reflect.ismapkey
func reflect_ismapkey(t *_type) bool {
return ismapkey(t)