Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for AllocMSpan (0.08 sec)

  1. src/runtime/gc_test.go

    		runtime.GC()
    		runtime.GC()
    		b.StopTimer()
    	}
    	close(teardown)
    }
    
    func BenchmarkMSpanCountAlloc(b *testing.B) {
    	// Allocate one dummy mspan for the whole benchmark.
    	s := runtime.AllocMSpan()
    	defer runtime.FreeMSpan(s)
    
    	// n is the number of bytes to benchmark against.
    	// n must always be a multiple of 8, since gcBits is
    	// always rounded up 8 bytes.
    	for _, n := range []int{8, 16, 32, 64, 128} {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Jun 05 22:33:52 UTC 2024
    - 17.6K bytes
    - Viewed (0)
  2. src/runtime/export_test.go

    	if s != nil {
    		releaseSudog(s)
    		return true
    	}
    	return false
    }
    
    // mspan wrapper for testing.
    type MSpan mspan
    
    // Allocate an mspan for testing.
    func AllocMSpan() *MSpan {
    	var s *mspan
    	systemstack(func() {
    		lock(&mheap_.lock)
    		s = (*mspan)(mheap_.spanalloc.alloc())
    		unlock(&mheap_.lock)
    	})
    	return (*MSpan)(s)
    }
    
    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