- Sort Score
- Result 10 results
- Languages All
Results 1 - 8 of 8 for divRoundUp (0.38 sec)
-
src/runtime/msize.go
// from the result if we have one, since mallocgc will add it back in. if reqSize <= smallSizeMax-8 { return uintptr(class_to_size[size_to_class8[divRoundUp(reqSize, smallSizeDiv)]]) - (reqSize - size) } return uintptr(class_to_size[size_to_class128[divRoundUp(reqSize-smallSizeMax, largeSizeDiv)]]) - (reqSize - size) } // Large object. Align reqSize up to the next page. Check for overflow. reqSize += pageSize - 1
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Apr 09 04:07:57 UTC 2024 - 1.3K bytes - Viewed (0) -
src/runtime/mem_wasm.go
// Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package runtime import "unsafe" func sbrk(n uintptr) unsafe.Pointer { grow := divRoundUp(n, physPageSize) size := growMemory(int32(grow)) if size < 0 { return nil } resetMemoryDataView() return unsafe.Pointer(uintptr(size) * physPageSize) } // Implemented in src/runtime/sys_wasm.s
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Apr 06 17:48:24 UTC 2023 - 488 bytes - Viewed (0) -
src/runtime/stubs.go
} // alignDown rounds n down to a multiple of a. a must be a power of 2. // //go:nosplit func alignDown(n, a uintptr) uintptr { return n &^ (a - 1) } // divRoundUp returns ceil(n / a). func divRoundUp(n, a uintptr) uintptr { // a is generally a power of two. This will get inlined and // the compiler will optimize the division. return (n + a - 1) / a }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed May 29 17:58:53 UTC 2024 - 20.2K bytes - Viewed (0) -
src/runtime/pinner.go
bytep, mask := (*gcBits)(p).bitp(n * 2) byteVal := atomic.Load8(bytep) return pinState{bytep, byteVal, mask} } func (s *mspan) pinnerBitSize() uintptr { return divRoundUp(uintptr(s.nelems)*2, 8) } // newPinnerBits returns a pointer to 8 byte aligned bytes to be used for this // span's pinner bits. newPinnerBits is used to mark objects that are pinned.
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Apr 04 14:29:45 UTC 2024 - 11K bytes - Viewed (0) -
src/runtime/mbitmap.go
func materializeGCProg(ptrdata uintptr, prog *byte) *mspan { // Each word of ptrdata needs one bit in the bitmap. bitmapBytes := divRoundUp(ptrdata, 8*goarch.PtrSize) // Compute the number of pages needed for bitmapBytes. pages := divRoundUp(bitmapBytes, pageSize) s := mheap_.allocManual(pages, spanAllocPtrScalarBits) runGCProg(addb(prog, 4), (*byte)(unsafe.Pointer(s.startAddr))) return s }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 23 00:18:55 UTC 2024 - 60K bytes - Viewed (0) -
src/runtime/malloc.go
if hasHeader { size += mallocHeaderSize } var sizeclass uint8 if size <= smallSizeMax-8 { sizeclass = size_to_class8[divRoundUp(size, smallSizeDiv)] } else { sizeclass = size_to_class128[divRoundUp(size-smallSizeMax, largeSizeDiv)] } size = uintptr(class_to_size[sizeclass]) spc := makeSpanClass(sizeclass, noscan) span = c.alloc[spc]
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed May 29 17:58:53 UTC 2024 - 59.6K bytes - Viewed (0) -
src/runtime/mgcsweep.go
obj := uintptr(s.freeindex) if (*s.gcmarkBits.bytep(obj / 8)&^*s.allocBits.bytep(obj / 8))>>(obj%8) != 0 { s.reportZombies() } // Check remaining bytes. for i := obj/8 + 1; i < divRoundUp(uintptr(s.nelems), 8); i++ { if *s.gcmarkBits.bytep(i)&^*s.allocBits.bytep(i) != 0 { s.reportZombies() } } } // Count the number of free objects in this span.
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed May 08 17:52:18 UTC 2024 - 32.9K bytes - Viewed (0) -
src/runtime/mgcmark.go
// // The world must be stopped. func gcMarkRootPrepare() { assertWorldStopped() // Compute how many data and BSS root blocks there are. nBlocks := func(bytes uintptr) int { return int(divRoundUp(bytes, rootBlockBytes)) } work.nDataRoots = 0 work.nBSSRoots = 0 // Scan globals. for _, datap := range activeModules() { nDataRoots := nBlocks(datap.edata - datap.data)
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Apr 18 21:25:11 UTC 2024 - 52.5K bytes - Viewed (0)