- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 19 for fixalloc (0.12 sec)
-
src/runtime/mfixalloc.go
// // See malloc.go for overview. package runtime import ( "runtime/internal/sys" "unsafe" ) // fixalloc is a simple free-list allocator for fixed size objects. // Malloc uses a FixAlloc wrapped around sysAlloc to manage its // mcache and mspan objects. // // Memory returned by fixalloc.alloc is zeroed by default, but the // caller may take responsibility for zeroing allocations by setting
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Oct 24 20:28:25 UTC 2023 - 3.1K bytes - Viewed (0) -
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) -
src/runtime/HACKING.md
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 size. fixalloced objects can be freed, but this memory can only be reused by the same fixalloc pool, so it can only be reused for objects of the same type. In general, types that are allocated using any of these should be
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Mar 25 19:53:03 UTC 2024 - 13.9K bytes - Viewed (0) -
src/runtime/mheap.go
} spanalloc fixalloc // allocator for span* cachealloc fixalloc // allocator for mcache* specialfinalizeralloc fixalloc // allocator for specialfinalizer* specialprofilealloc fixalloc // allocator for specialprofile* specialReachableAlloc fixalloc // allocator for specialReachable specialPinCounterAlloc fixalloc // allocator for specialPinCounter
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed May 22 22:31:00 UTC 2024 - 78K bytes - Viewed (0) -
src/runtime/malloc.go
// maxAlloc is the maximum size of an allocation. On 64-bit, // it's theoretically possible to allocate 1<<heapAddrBits bytes. On // 32-bit, however, this is one less than 1<<32 because the // number of bytes in the address space doesn't actually fit // in a uintptr. maxAlloc = (1 << heapAddrBits) - (1-_64bit)*1
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/slice.go
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 newcap = int(capmem / goarch.PtrSize) case isPowerOfTwo(et.Size_):
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed May 29 16:25:21 UTC 2024 - 12.2K bytes - Viewed (0) -
src/cmd/compile/internal/ssa/id.go
// Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package ssa type ID int32 // idAlloc provides an allocator for unique integers. type idAlloc struct { last ID } // get allocates an ID and returns it. IDs are always > 0. func (a *idAlloc) get() ID { x := a.last x++ if x == 1<<31-1 { panic("too many ids for this function") } a.last = x return x }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri Apr 22 19:21:16 UTC 2016 - 576 bytes - Viewed (0) -
test/chancap.go
panic("fail") } n := -1 shouldPanic("makechan: size out of range", func() { _ = make(T, n) }) shouldPanic("makechan: size out of range", func() { _ = make(T, int64(n)) }) if ptrSize == 8 { // Test mem > maxAlloc var n2 int64 = 1 << 59 shouldPanic("makechan: size out of range", func() { _ = make(T, int(n2)) }) // Test elem.size*cap overflow n2 = 1<<63 - 1
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Nov 26 14:06:28 UTC 2018 - 1.6K bytes - Viewed (0) -
src/runtime/string.go
*(*slice)(unsafe.Pointer(&b)) = slice{p, size, int(cap)} return } // rawruneslice allocates a new rune slice. The rune slice is not zeroed. func rawruneslice(size int) (b []rune) { if uintptr(size) > maxAlloc/4 { throw("out of memory") } mem := roundupsize(uintptr(size)*4, true) p := mallocgc(mem, nil, false) if mem != uintptr(size)*4 { memclrNoHeapPointers(add(p, uintptr(size)*4), mem-uintptr(size)*4) }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 23 01:17:26 UTC 2024 - 13.4K bytes - Viewed (0) -
staging/src/k8s.io/apiserver/pkg/util/flowcontrol/fairqueuing/queueset/queueset_test.go
return alloc } func TestFairAlloc(t *testing.T) { if e, a := []float64{0, 0}, fairAlloc([]float64{0, 0}, 42); !reflect.DeepEqual(e, a) { t.Errorf("Expected %#+v, got #%+v", e, a) } if e, a := []float64{42, 0}, fairAlloc([]float64{47, 0}, 42); !reflect.DeepEqual(e, a) { t.Errorf("Expected %#+v, got #%+v", e, a) } if e, a := []float64{1, 41}, fairAlloc([]float64{1, 47}, 42); !reflect.DeepEqual(e, a) {
Registered: Sat Jun 15 01:39:40 UTC 2024 - Last Modified: Tue Sep 26 12:55:23 UTC 2023 - 58.4K bytes - Viewed (0)