Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for roundupsize (0.09 sec)

  1. src/runtime/slice.go

    	case et.Size_ == 1:
    		lenmem = uintptr(oldLen)
    		newlenmem = uintptr(newLen)
    		capmem = roundupsize(uintptr(newcap), noscan)
    		overflow = uintptr(newcap) > maxAlloc
    		newcap = int(capmem)
    	case et.Size_ == goarch.PtrSize:
    		lenmem = uintptr(oldLen) * goarch.PtrSize
    		newlenmem = uintptr(newLen) * goarch.PtrSize
    		capmem = roundupsize(uintptr(newcap)*goarch.PtrSize, noscan)
    		overflow = uintptr(newcap) > maxAlloc/goarch.PtrSize
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 29 16:25:21 UTC 2024
    - 12.2K bytes
    - Viewed (0)
  2. src/runtime/string.go

    	return unsafe.String((*byte)(p), size), unsafe.Slice((*byte)(p), size)
    }
    
    // rawbyteslice allocates a new byte slice. The byte slice is not zeroed.
    func rawbyteslice(size int) (b []byte) {
    	cap := roundupsize(uintptr(size), true)
    	p := mallocgc(cap, nil, false)
    	if cap != uintptr(size) {
    		memclrNoHeapPointers(add(p, uintptr(size)), cap-uintptr(size))
    	}
    
    	*(*slice)(unsafe.Pointer(&b)) = slice{p, size, int(cap)}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:17:26 UTC 2024
    - 13.4K bytes
    - Viewed (0)
Back to top