Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 28 for Malloc (0.12 sec)

  1. src/runtime/malloc.go

    			minSizeForMallocHeaderIsSizeClass = true
    			break
    		}
    	}
    	if !minSizeForMallocHeaderIsSizeClass {
    		throw("min size of malloc header is not a size class boundary")
    	}
    	// Check that the pointer bitmap for all small sizes without a malloc header
    	// fits in a word.
    	if minSizeForMallocHeader/goarch.PtrSize > 8*goarch.PtrSize {
    		throw("max pointer/scan bitmap size for headerless objects is too large")
    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/cmd/cgo/out.go

    const char *_cgoPREFIX_Cfunc_CString(struct __go_string s) {
    	char *p = malloc(s.__length+1);
    	if(p == NULL)
    		runtime_throw("runtime: C malloc failed");
    	memmove(p, s.__data, s.__length);
    	p[s.__length] = 0;
    	return p;
    }
    
    void *_cgoPREFIX_Cfunc_CBytes(struct __go_open_array b) {
    	char *p = malloc(b.__count);
    	if(p == NULL)
    		runtime_throw("runtime: C malloc failed");
    	memmove(p, b.__values, b.__count);
    	return p;
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Mar 29 16:41:10 UTC 2024
    - 59.6K bytes
    - Viewed (0)
  3. src/runtime/mbitmap.go

    	"runtime/internal/sys"
    	"unsafe"
    )
    
    const (
    	// A malloc header is functionally a single type pointer, but
    	// we need to use 8 here to ensure 8-byte alignment of allocations
    	// on 32-bit platforms. It's wasteful, but a lot of code relies on
    	// 8-byte alignment for 8-byte atomics.
    	mallocHeaderSize = 8
    
    	// The minimum object size that has a malloc header, exclusive.
    	//
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 00:18:55 UTC 2024
    - 60K bytes
    - Viewed (0)
  4. src/runtime/mheap.go

    func (s spanAllocType) manual() bool {
    	return s != spanAllocHeap
    }
    
    // alloc allocates a new span of npage pages from the GC'd heap.
    //
    // spanclass indicates the span's size class and scannability.
    //
    // Returns a span that has been fully initialized. span.needzero indicates
    // whether the span has been zeroed. Note that it may not be.
    func (h *mheap) alloc(npages uintptr, spanclass spanClass) *mspan {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 22 22:31:00 UTC 2024
    - 78K bytes
    - Viewed (0)
  5. src/runtime/mprof.go

    	// The following complex 3-stage scheme of stats accumulation
    	// is required to obtain a consistent picture of mallocs and frees
    	// for some point in time.
    	// The problem is that mallocs come in real time, while frees
    	// come only after a GC during concurrent sweeping. So if we would
    	// naively count them, we would get a skew toward mallocs.
    	//
    	// Hence, we delay information to get consistent snapshots as
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 17:57:37 UTC 2024
    - 53.3K bytes
    - Viewed (0)
  6. src/fmt/fmt_test.go

    	case testing.Short():
    		t.Skip("skipping malloc count in short mode")
    	case runtime.GOMAXPROCS(0) > 1:
    		t.Skip("skipping; GOMAXPROCS>1")
    	case race.Enabled:
    		t.Skip("skipping malloc count under race detector")
    	}
    	for _, mt := range mallocTest {
    		mallocs := testing.AllocsPerRun(100, mt.fn)
    		if got, max := mallocs, float64(mt.count); got > max {
    			t.Errorf("%s: got %v allocs, want <=%v", mt.desc, got, max)
    		}
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 04 17:31:55 UTC 2024
    - 58.6K bytes
    - Viewed (0)
  7. src/runtime/mgcmark.go

    	// Clear the flag indicating that this assist completed the
    	// mark phase.
    	gp.param = nil
    
    	if atomic.Load(&gcBlackenEnabled) == 0 {
    		// The gcBlackenEnabled check in malloc races with the
    		// store that clears it but an atomic check in every malloc
    		// would be a performance hit.
    		// Instead we recheck it here on the non-preemptible system
    		// stack to determine if we should perform an assist.
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Apr 18 21:25:11 UTC 2024
    - 52.5K bytes
    - Viewed (0)
  8. src/runtime/mgc.go

    //
    // This may return without performing this transition in some cases,
    // such as when called on a system stack or with locks held.
    func gcStart(trigger gcTrigger) {
    	// Since this is called from malloc and malloc is called in
    	// the guts of a number of libraries that might be holding
    	// locks, don't attempt to start GC in non-preemptible or
    	// potentially unstable situations.
    	mp := acquirem()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 29 16:25:21 UTC 2024
    - 62K bytes
    - Viewed (0)
  9. src/cmd/cgo/gcc.go

    			"-Wno-unknown-warning-option",
    			"-Wno-unneeded-internal-declaration",
    			"-Wno-unused-function",
    			"-Qunused-arguments",
    			// Clang embeds prototypes for some builtin functions,
    			// like malloc and calloc, but all size_t parameters are
    			// incorrectly typed unsigned long. We work around that
    			// by disabling the builtin functions (this is safe as
    			// it won't affect the actual compilation of the C code).
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 20 15:50:06 UTC 2024
    - 97K bytes
    - Viewed (0)
  10. src/time/time_test.go

    func TestCountMallocs(t *testing.T) {
    	if testing.Short() {
    		t.Skip("skipping malloc count in short mode")
    	}
    	if runtime.GOMAXPROCS(0) > 1 {
    		t.Skip("skipping; GOMAXPROCS>1")
    	}
    	for _, mt := range mallocTest {
    		allocs := int(testing.AllocsPerRun(100, mt.fn))
    		if allocs > mt.count {
    			t.Errorf("%s: %d allocs, want %d", mt.desc, allocs, mt.count)
    		}
    	}
    }
    
    func TestLoadFixed(t *testing.T) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 03:13:47 UTC 2024
    - 56.5K bytes
    - Viewed (0)
Back to top