Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 5 of 5 for MapMaxKeyBytes (0.29 sec)

  1. src/internal/abi/map.go

    	// Maximum key or elem size to keep inline (instead of mallocing per element).
    	// Must fit in a uint8.
    	// Note: fast map functions cannot handle big elems (bigger than MapMaxElemBytes).
    	MapMaxKeyBytes  = 128
    	MapMaxElemBytes = 128 // Must fit in a uint8.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Apr 22 20:09:01 UTC 2024
    - 719 bytes
    - Viewed (0)
  2. src/runtime/map.go

    	// Check invariants and reflects math.
    	if t.Key.Equal == nil {
    		throw("runtime.reflect_makemap: unsupported map key type")
    	}
    	if t.Key.Size_ > abi.MapMaxKeyBytes && (!t.IndirectKey() || t.KeySize != uint8(goarch.PtrSize)) ||
    		t.Key.Size_ <= abi.MapMaxKeyBytes && (t.IndirectKey() || t.KeySize != uint8(t.Key.Size_)) {
    		throw("key size wrong")
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 29 17:58:53 UTC 2024
    - 57.6K bytes
    - Viewed (0)
  3. src/runtime/map_test.go

    			t.Errorf("OverLoadFactor(%d,%d)=false, want true", count+1, b)
    		}
    	}
    }
    
    func TestMapKeys(t *testing.T) {
    	type key struct {
    		s   string
    		pad [128]byte // sizeof(key) > abi.MapMaxKeyBytes
    	}
    	m := map[key]int{{s: "a"}: 1, {s: "b"}: 2}
    	keys := make([]key, 0, len(m))
    	runtime.MapKeys(m, unsafe.Pointer(&keys))
    	for _, k := range keys {
    		if len(k.s) != 1 {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 33.5K bytes
    - Viewed (0)
  4. src/reflect/type.go

    	mt.Key = ktyp
    	mt.Elem = etyp
    	mt.Bucket = bucketOf(ktyp, etyp)
    	mt.Hasher = func(p unsafe.Pointer, seed uintptr) uintptr {
    		return typehash(ktyp, p, seed)
    	}
    	mt.Flags = 0
    	if ktyp.Size_ > abi.MapMaxKeyBytes {
    		mt.KeySize = uint8(goarch.PtrSize)
    		mt.Flags |= 1 // indirect key
    	} else {
    		mt.KeySize = uint8(ktyp.Size_)
    	}
    	if etyp.Size_ > abi.MapMaxElemBytes {
    		mt.ValueSize = uint8(goarch.PtrSize)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 29 17:58:53 UTC 2024
    - 85.5K bytes
    - Viewed (0)
  5. src/cmd/link/internal/ld/dwarf.go

    		keytype, valtype = d.walksymtypedef(d.defgotype(keytype)), d.walksymtypedef(d.defgotype(valtype))
    
    		// compute size info like hashmap.c does.
    		indirectKey, indirectVal := false, false
    		if keysize > abi.MapMaxKeyBytes {
    			keysize = int64(d.arch.PtrSize)
    			indirectKey = true
    		}
    		if valsize > abi.MapMaxElemBytes {
    			valsize = int64(d.arch.PtrSize)
    			indirectVal = true
    		}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 02 16:25:18 UTC 2024
    - 72.4K bytes
    - Viewed (0)
Back to top