]> Cypherpunks repositories - gostls13.git/commitdiff
reflect: unexport BUCKETSIZE, MAXKEYSIZE, MAXVALSIZE
authorBrad Fitzpatrick <bradfitz@golang.org>
Fri, 6 Sep 2013 19:00:42 +0000 (12:00 -0700)
committerBrad Fitzpatrick <bradfitz@golang.org>
Fri, 6 Sep 2013 19:00:42 +0000 (12:00 -0700)
But keep their case for ease of searching.

They were added recently. We don't want them part of go1.2's API.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/13569044

src/pkg/reflect/type.go

index 9686cfe0ebb2c8f0ea34afa4954b87531a6cfc02..f8ed8c399a7bba2687e41a348a7e4c15af7b1bc3 100644 (file)
@@ -1539,40 +1539,40 @@ func MapOf(key, elem Type) Type {
 // Currently, that's just size and the GC program.  We also fill in string
 // for possible debugging use.
 const (
-       BUCKETSIZE = 8
-       MAXKEYSIZE = 128
-       MAXVALSIZE = 128
+       _BUCKETSIZE = 8
+       _MAXKEYSIZE = 128
+       _MAXVALSIZE = 128
 )
 
 func bucketOf(ktyp, etyp *rtype) *rtype {
-       if ktyp.size > MAXKEYSIZE {
+       if ktyp.size > _MAXKEYSIZE {
                ktyp = PtrTo(ktyp).(*rtype)
        }
-       if etyp.size > MAXVALSIZE {
+       if etyp.size > _MAXVALSIZE {
                etyp = PtrTo(etyp).(*rtype)
        }
        ptrsize := unsafe.Sizeof(uintptr(0))
 
        gc := make([]uintptr, 1)                                       // first entry is size, filled in at the end
-       offset := BUCKETSIZE * unsafe.Sizeof(uint8(0))                 // topbits
+       offset := _BUCKETSIZE * unsafe.Sizeof(uint8(0))                // topbits
        gc = append(gc, _GC_PTR, offset, 0 /*self pointer set below*/) // overflow
        offset += ptrsize
 
        // keys
        if ktyp.kind&kindNoPointers == 0 {
-               gc = append(gc, _GC_ARRAY_START, offset, BUCKETSIZE, ktyp.size)
+               gc = append(gc, _GC_ARRAY_START, offset, _BUCKETSIZE, ktyp.size)
                gc = appendGCProgram(gc, ktyp)
                gc = append(gc, _GC_ARRAY_NEXT)
        }
-       offset += BUCKETSIZE * ktyp.size
+       offset += _BUCKETSIZE * ktyp.size
 
        // values
        if etyp.kind&kindNoPointers == 0 {
-               gc = append(gc, _GC_ARRAY_START, offset, BUCKETSIZE, etyp.size)
+               gc = append(gc, _GC_ARRAY_START, offset, _BUCKETSIZE, etyp.size)
                gc = appendGCProgram(gc, etyp)
                gc = append(gc, _GC_ARRAY_NEXT)
        }
-       offset += BUCKETSIZE * etyp.size
+       offset += _BUCKETSIZE * etyp.size
 
        gc = append(gc, _GC_END)
        gc[0] = offset