Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 18 for persistentalloc1 (0.21 sec)

  1. src/runtime/malloc.go

    // See issue 9174.
    //
    //go:systemstack
    func persistentalloc1(size, align uintptr, sysStat *sysMemStat) *notInHeap {
    	const (
    		maxBlock = 64 << 10 // VM reservation granularity is 64K on windows
    	)
    
    	if size == 0 {
    		throw("persistentalloc: size == 0")
    	}
    	if align != 0 {
    		if align&(align-1) != 0 {
    			throw("persistentalloc: align is not a power of 2")
    		}
    		if align > _PageSize {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 29 17:58:53 UTC 2024
    - 59.6K bytes
    - Viewed (0)
  2. src/runtime/mranges.go

    	sysStat *sysMemStat
    }
    
    func (a *addrRanges) init(sysStat *sysMemStat) {
    	ranges := (*notInHeapSlice)(unsafe.Pointer(&a.ranges))
    	ranges.len = 0
    	ranges.cap = 16
    	ranges.array = (*notInHeap)(persistentalloc(unsafe.Sizeof(addrRange{})*uintptr(ranges.cap), goarch.PtrSize, sysStat))
    	a.sysStat = sysStat
    	a.totalBytes = 0
    }
    
    // findSucc returns the first index in a such that addr is
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 25 19:53:03 UTC 2024
    - 14.5K bytes
    - Viewed (0)
  3. src/runtime/mspanset.go

    	stack lfstack
    }
    
    // alloc tries to grab a spanSetBlock out of the pool, and if it fails
    // persistentallocs a new one and returns it.
    func (p *spanSetBlockAlloc) alloc() *spanSetBlock {
    	if s := (*spanSetBlock)(p.stack.pop()); s != nil {
    		return s
    	}
    	return (*spanSetBlock)(persistentalloc(unsafe.Sizeof(spanSetBlock{}), cpu.CacheLineSize, &memstats.gcMiscSys))
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 25 19:53:03 UTC 2024
    - 13.1K bytes
    - Viewed (0)
  4. src/runtime/internal/sys/nih.go

    // to these types must always fail the `runtime.inheap` check. The type may be used
    // for global variables, or for objects in unmanaged memory (e.g., allocated with
    // `sysAlloc`, `persistentalloc`, r`fixalloc`, or from a manually-managed span).
    //
    // Specifically:
    //
    // 1. `new(T)`, `make([]T)`, `append([]T, ...)` and implicit heap
    // allocation of T are disallowed. (Though implicit allocations are
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Sep 02 18:24:50 UTC 2022
    - 1.7K bytes
    - Viewed (0)
  5. src/runtime/mcheckmark.go

    	for _, ai := range mheap_.allArenas {
    		arena := mheap_.arenas[ai.l1()][ai.l2()]
    		bitmap := arena.checkmarks
    
    		if bitmap == nil {
    			// Allocate bitmap on first use.
    			bitmap = (*checkmarksMap)(persistentalloc(unsafe.Sizeof(*bitmap), 0, &memstats.gcMiscSys))
    			if bitmap == nil {
    				throw("out of memory allocating checkmarks bitmap")
    			}
    			arena.checkmarks = bitmap
    		} else {
    			// Otherwise clear the existing bitmap.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 25 19:53:03 UTC 2024
    - 2.8K bytes
    - Viewed (0)
  6. src/runtime/mfixalloc.go

    		v := unsafe.Pointer(f.list)
    		f.list = f.list.next
    		f.inuse += f.size
    		if f.zero {
    			memclrNoHeapPointers(v, f.size)
    		}
    		return v
    	}
    	if uintptr(f.nchunk) < f.size {
    		f.chunk = uintptr(persistentalloc(uintptr(f.nalloc), 0, f.stat))
    		f.nchunk = f.nalloc
    	}
    
    	v := unsafe.Pointer(f.chunk)
    	if f.first != nil {
    		f.first(f.arg, v)
    	}
    	f.chunk = f.chunk + f.size
    	f.nchunk -= uint32(f.size)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Oct 24 20:28:25 UTC 2023
    - 3.1K bytes
    - Viewed (0)
  7. src/runtime/lfstack_test.go

    // outside the Go heap.
    // We require lfstack objects to live outside the heap so that
    // checkptr passes on the unsafe shenanigans used.
    func allocMyNode(data int) *MyNode {
    	n := (*MyNode)(PersistentAlloc(unsafe.Sizeof(MyNode{})))
    	LFNodeValidate(&n.LFNode)
    	n.data = data
    	return n
    }
    
    func fromMyNode(node *MyNode) *LFNode {
    	return (*LFNode)(unsafe.Pointer(node))
    }
    
    func toMyNode(node *LFNode) *MyNode {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Nov 17 23:12:04 UTC 2022
    - 2.7K bytes
    - Viewed (0)
  8. src/runtime/HACKING.md

    * sysAlloc obtains memory directly from the OS. This comes in whole
      multiples of the system page size, but it can be freed with sysFree.
    
    * persistentalloc combines multiple smaller allocations into a single
      sysAlloc to avoid fragmentation. However, there is no way to free
      persistentalloced objects (hence the name).
    
    * fixalloc is a SLAB-style allocator that allocates objects of a fixed
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 25 19:53:03 UTC 2024
    - 13.9K bytes
    - Viewed (0)
  9. src/cmd/compile/internal/typebits/typebits.go

    		}
    		// The first word of an interface is a pointer, but we don't
    		// treat it as such.
    		// 1. If it is a non-empty interface, the pointer points to an itab
    		//    which is always in persistentalloc space.
    		// 2. If it is an empty interface, the pointer points to a _type.
    		//   a. If it is a compile-time-allocated type, it points into
    		//      the read-only data section.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Aug 22 01:53:41 UTC 2023
    - 3.2K bytes
    - Viewed (0)
  10. src/runtime/export_test.go

    }
    
    func FrameStartLine(f *Frame) int {
    	return f.startLine
    }
    
    // PersistentAlloc allocates some memory that lives outside the Go heap.
    // This memory will never be freed; use sparingly.
    func PersistentAlloc(n uintptr) unsafe.Pointer {
    	return persistentalloc(n, 0, &memstats.other_sys)
    }
    
    // FPCallers works like Callers and uses frame pointer unwinding to populate
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 17:50:53 UTC 2024
    - 46.1K bytes
    - Viewed (0)
Back to top