Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 5 of 5 for heapBitsInSpan (0.35 sec)

  1. src/runtime/msize.go

    func roundupsize(size uintptr, noscan bool) (reqSize uintptr) {
    	reqSize = size
    	if reqSize <= maxSmallSize-mallocHeaderSize {
    		// Small object.
    		if !noscan && reqSize > minSizeForMallocHeader { // !noscan && !heapBitsInSpan(reqSize)
    			reqSize += mallocHeaderSize
    		}
    		// (reqSize - size) is either mallocHeaderSize or 0. We need to subtract mallocHeaderSize
    		// from the result if we have one, since mallocgc will add it back in.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 09 04:07:57 UTC 2024
    - 1.3K bytes
    - Viewed (0)
  2. src/runtime/mbitmap.go

    func heapSetType(x, dataSize uintptr, typ *_type, header **_type, span *mspan) (scanSize uintptr) {
    	const doubleCheck = false
    
    	gctyp := typ
    	if header == nil {
    		if doubleCheck && (!heapBitsInSpan(dataSize) || !heapBitsInSpan(span.elemsize)) {
    			throw("tried to write heap bits, but no heap bits in span")
    		}
    		// Handle the case where we have no malloc header.
    		scanSize = span.writeHeapBitsSmall(x, dataSize, typ)
    	} else {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 00:18:55 UTC 2024
    - 60K bytes
    - Viewed (0)
  3. src/runtime/mfinal.go

    			return
    		}
    		throw("runtime.SetFinalizer: pointer not in allocated block")
    	}
    
    	// Move base forward if we've got an allocation header.
    	if !span.spanclass.noscan() && !heapBitsInSpan(span.elemsize) && span.spanclass.sizeclass() != 0 {
    		base += mallocHeaderSize
    	}
    
    	if uintptr(e.data) != base {
    		// As an implementation detail we allow to set finalizers for an inner byte
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Jun 07 01:56:56 UTC 2024
    - 19K bytes
    - Viewed (0)
  4. src/runtime/malloc.go

    				// Note: disabled when race detector is on, see comment near end of this function.
    				c.tiny = uintptr(x)
    				c.tinyoffset = size
    			}
    			size = maxTinySize
    		} else {
    			hasHeader := !noscan && !heapBitsInSpan(size)
    			if hasHeader {
    				size += mallocHeaderSize
    			}
    			var sizeclass uint8
    			if size <= smallSizeMax-8 {
    				sizeclass = size_to_class8[divRoundUp(size, smallSizeDiv)]
    			} else {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 29 17:58:53 UTC 2024
    - 59.6K bytes
    - Viewed (0)
  5. src/runtime/mheap.go

    		if sizeclass := spanclass.sizeclass(); sizeclass == 0 {
    			s.elemsize = nbytes
    			s.nelems = 1
    			s.divMul = 0
    		} else {
    			s.elemsize = uintptr(class_to_size[sizeclass])
    			if !s.spanclass.noscan() && heapBitsInSpan(s.elemsize) {
    				// Reserve space for the pointer/scan bitmap at the end.
    				s.nelems = uint16((nbytes - (nbytes / goarch.PtrSize / 8)) / s.elemsize)
    			} else {
    				s.nelems = uint16(nbytes / s.elemsize)
    			}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 22 22:31:00 UTC 2024
    - 78K bytes
    - Viewed (0)
Back to top