$19 GRAYBYTE WORDPRESS FILE MANAGER $30

SERVER : vnpttt-amd7f72-h1.vietnix.vn #1 SMP Fri May 24 12:42:50 UTC 2024
SERVER IP : 103.200.23.149 | ADMIN IP 216.73.216.22
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : NONE

/lib/golang/src/runtime/

HOME
Current File : /lib/golang/src/runtime//mgcscavenge.go
// Copyright 2019 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

// Scavenging free pages.
//
// This file implements scavenging (the release of physical pages backing mapped
// memory) of free and unused pages in the heap as a way to deal with page-level
// fragmentation and reduce the RSS of Go applications.
//
// Scavenging in Go happens on two fronts: there's the background
// (asynchronous) scavenger and the allocation-time (synchronous) scavenger.
//
// The former happens on a goroutine much like the background sweeper which is
// soft-capped at using scavengePercent of the mutator's time, based on
// order-of-magnitude estimates of the costs of scavenging. The latter happens
// when allocating pages from the heap.
//
// The scavenger's primary goal is to bring the estimated heap RSS of the
// application down to a goal.
//
// Before we consider what this looks like, we need to split the world into two
// halves. One in which a memory limit is not set, and one in which it is.
//
// For the former, the goal is defined as:
//   (retainExtraPercent+100) / 100 * (heapGoal / lastHeapGoal) * lastHeapInUse
//
// Essentially, we wish to have the application's RSS track the heap goal, but
// the heap goal is defined in terms of bytes of objects, rather than pages like
// RSS. As a result, we need to take into account for fragmentation internal to
// spans. heapGoal / lastHeapGoal defines the ratio between the current heap goal
// and the last heap goal, which tells us by how much the heap is growing and
// shrinking. We estimate what the heap will grow to in terms of pages by taking
// this ratio and multiplying it by heapInUse at the end of the last GC, which
// allows us to account for this additional fragmentation. Note that this
// procedure makes the assumption that the degree of fragmentation won't change
// dramatically over the next GC cycle. Overestimating the amount of
// fragmentation simply results in higher memory use, which will be accounted
// for by the next pacing up date. Underestimating the fragmentation however
// could lead to performance degradation. Handling this case is not within the
// scope of the scavenger. Situations where the amount of fragmentation balloons
// over the course of a single GC cycle should be considered pathologies,
// flagged as bugs, and fixed appropriately.
//
// An additional factor of retainExtraPercent is added as a buffer to help ensure
// that there's more unscavenged memory to allocate out of, since each allocation
// out of scavenged memory incurs a potentially expensive page fault.
//
// If a memory limit is set, then we wish to pick a scavenge goal that maintains
// that memory limit. For that, we look at total memory that has been committed
// (memstats.mappedReady) and try to bring that down below the limit. In this case,
// we want to give buffer space in the *opposite* direction. When the application
// is close to the limit, we want to make sure we push harder to keep it under, so
// if we target below the memory limit, we ensure that the background scavenger is
// giving the situation the urgency it deserves.
//
// In this case, the goal is defined as:
//    (100-reduceExtraPercent) / 100 * memoryLimit
//
// We compute both of these goals, and check whether either of them have been met.
// The background scavenger continues operating as long as either one of the goals
// has not been met.
//
// The goals are updated after each GC.
//
// Synchronous scavenging happens for one of two reasons: if an allocation would
// exceed the memory limit or whenever the heap grows in size, for some
// definition of heap-growth. The intuition behind this second reason is that the
// application had to grow the heap because existing fragments were not sufficiently
// large to satisfy a page-level memory allocation, so we scavenge those fragments
// eagerly to offset the growth in RSS that results.
//
// Lastly, not all pages are available for scavenging at all times and in all cases.
// The background scavenger and heap-growth scavenger only release memory in chunks
// that have not been densely-allocated for at least 1 full GC cycle. The reason
// behind this is likelihood of reuse: the Go heap is allocated in a first-fit order
// and by the end of the GC mark phase, the heap tends to be densely packed. Releasing
// memory in these densely packed chunks while they're being packed is counter-productive,
// and worse, it breaks up huge pages on systems that support them. The scavenger (invoked
// during memory allocation) further ensures that chunks it identifies as "dense" are
// immediately eligible for being backed by huge pages. Note that for the most part these
// density heuristics are best-effort heuristics. It's totally possible (but unlikely)
// that a chunk that just became dense is scavenged in the case of a race between memory
// allocation and scavenging.
//
// When synchronously scavenging for the memory limit or for debug.FreeOSMemory, these
// "dense" packing heuristics are ignored (in other words, scavenging is "forced") because
// in these scenarios returning memory to the OS is more important than keeping CPU
// overheads low.

package runtime

import (
	"internal/goos"
	"internal/runtime/atomic"
	"internal/runtime/sys"
	"unsafe"
)

const (
	// The background scavenger is paced according to these parameters.
	//
	// scavengePercent represents the portion of mutator time we're willing
	// to spend on scavenging in percent.
	scavengePercent = 1 // 1%

	// retainExtraPercent represents the amount of memory over the heap goal
	// that the scavenger should keep as a buffer space for the allocator.
	// This constant is used when we do not have a memory limit set.
	//
	// The purpose of maintaining this overhead is to have a greater pool of
	// unscavenged memory available for allocation (since using scavenged memory
	// incurs an additional cost), to account for heap fragmentation and
	// the ever-changing layout of the heap.
	retainExtraPercent = 10

	// reduceExtraPercent represents the amount of memory under the limit
	// that the scavenger should target. For example, 5 means we target 95%
	// of the limit.
	//
	// The purpose of shooting lower than the limit is to ensure that, once
	// close to the limit, the scavenger is working hard to maintain it. If
	// we have a memory limit set but are far away from it, there's no harm
	// in leaving up to 100-retainExtraPercent live, and it's more efficient
	// anyway, for the same reasons that retainExtraPercent exists.
	reduceExtraPercent = 5

	// maxPagesPerPhysPage is the maximum number of supported runtime pages per
	// physical page, based on maxPhysPageSize.
	maxPagesPerPhysPage = maxPhysPageSize / pageSize

	// scavengeCostRatio is the approximate ratio between the costs of using previously
	// scavenged memory and scavenging memory.
	//
	// For most systems the cost of scavenging greatly outweighs the costs
	// associated with using scavenged memory, making this constant 0. On other systems
	// (especially ones where "sysUsed" is not just a no-op) this cost is non-trivial.
	//
	// This ratio is used as part of multiplicative factor to help the scavenger account
	// for the additional costs of using scavenged memory in its pacing.
	scavengeCostRatio = 0.7 * (goos.IsDarwin + goos.IsIos)

	// scavChunkHiOcFrac indicates the fraction of pages that need to be allocated
	// in the chunk in a single GC cycle for it to be considered high density.
	scavChunkHiOccFrac  = 0.96875
	scavChunkHiOccPages = uint16(scavChunkHiOccFrac * pallocChunkPages)
)

// heapRetained returns an estimate of the current heap RSS.
func heapRetained() uint64 {
	return gcController.heapInUse.load() + gcController.heapFree.load()
}

// gcPaceScavenger updates the scavenger's pacing, particularly
// its rate and RSS goal. For this, it requires the current heapGoal,
// and the heapGoal for the previous GC cycle.
//
// The RSS goal is based on the current heap goal with a small overhead
// to accommodate non-determinism in the allocator.
//
// The pacing is based on scavengePageRate, which applies to both regular and
// huge pages. See that constant for more information.
//
// Must be called whenever GC pacing is updated.
//
// mheap_.lock must be held or the world must be stopped.
func gcPaceScavenger(memoryLimit int64, heapGoal, lastHeapGoal uint64) {
	assertWorldStoppedOrLockHeld(&mheap_.lock)

	// As described at the top of this file, there are two scavenge goals here: one
	// for gcPercent and one for memoryLimit. Let's handle the latter first because
	// it's simpler.

	// We want to target retaining (100-reduceExtraPercent)% of the heap.
	memoryLimitGoal := uint64(float64(memoryLimit) * (1 - reduceExtraPercent/100.0))

	// mappedReady is comparable to memoryLimit, and represents how much total memory
	// the Go runtime has committed now (estimated).
	mappedReady := gcController.mappedReady.Load()

	// If we're below the goal already indicate that we don't need the background
	// scavenger for the memory limit. This may seems worrisome at first, but note
	// that the allocator will assist the background scavenger in the face of a memory
	// limit, so we'll be safe even if we stop the scavenger when we shouldn't have.
	if mappedReady <= memoryLimitGoal {
		scavenge.memoryLimitGoal.Store(^uint64(0))
	} else {
		scavenge.memoryLimitGoal.Store(memoryLimitGoal)
	}

	// Now handle the gcPercent goal.

	// If we're called before the first GC completed, disable scavenging.
	// We never scavenge before the 2nd GC cycle anyway (we don't have enough
	// information about the heap yet) so this is fine, and avoids a fault
	// or garbage data later.
	if lastHeapGoal == 0 {
		scavenge.gcPercentGoal.Store(^uint64(0))
		return
	}
	// Compute our scavenging goal.
	goalRatio := float64(heapGoal) / float64(lastHeapGoal)
	gcPercentGoal := uint64(float64(memstats.lastHeapInUse) * goalRatio)
	// Add retainExtraPercent overhead to retainedGoal. This calculation
	// looks strange but the purpose is to arrive at an integer division
	// (e.g. if retainExtraPercent = 12.5, then we get a divisor of 8)
	// that also avoids the overflow from a multiplication.
	gcPercentGoal += gcPercentGoal / (1.0 / (retainExtraPercent / 100.0))
	// Align it to a physical page boundary to make the following calculations
	// a bit more exact.
	gcPercentGoal = (gcPercentGoal + uint64(physPageSize) - 1) &^ (uint64(physPageSize) - 1)

	// Represents where we are now in the heap's contribution to RSS in bytes.
	//
	// Guaranteed to always be a multiple of physPageSize on systems where
	// physPageSize <= pageSize since we map new heap memory at a size larger than
	// any physPageSize and released memory in multiples of the physPageSize.
	//
	// However, certain functions recategorize heap memory as other stats (e.g.
	// stacks) and this happens in multiples of pageSize, so on systems
	// where physPageSize > pageSize the calculations below will not be exact.
	// Generally this is OK since we'll be off by at most one regular
	// physical page.
	heapRetainedNow := heapRetained()

	// If we're already below our goal, or within one page of our goal, then indicate
	// that we don't need the background scavenger for maintaining a memory overhead
	// proportional to the heap goal.
	if heapRetainedNow <= gcPercentGoal || heapRetainedNow-gcPercentGoal < uint64(physPageSize) {
		scavenge.gcPercentGoal.Store(^uint64(0))
	} else {
		scavenge.gcPercentGoal.Store(gcPercentGoal)
	}
}

var scavenge struct {
	// gcPercentGoal is the amount of retained heap memory (measured by
	// heapRetained) that the runtime will try to maintain by returning
	// memory to the OS. This goal is derived from gcController.gcPercent
	// by choosing to retain enough memory to allocate heap memory up to
	// the heap goal.
	gcPercentGoal atomic.Uint64

	// memoryLimitGoal is the amount of memory retained by the runtime (
	// measured by gcController.mappedReady) that the runtime will try to
	// maintain by returning memory to the OS. This goal is derived from
	// gcController.memoryLimit by choosing to target the memory limit or
	// some lower target to keep the scavenger working.
	memoryLimitGoal atomic.Uint64

	// assistTime is the time spent by the allocator scavenging in the last GC cycle.
	//
	// This is reset once a GC cycle ends.
	assistTime atomic.Int64

	// backgroundTime is the time spent by the background scavenger in the last GC cycle.
	//
	// This is reset once a GC cycle ends.
	backgroundTime atomic.Int64
}

const (
	// It doesn't really matter what value we start at, but we can't be zero, because
	// that'll cause divide-by-zero issues. Pick something conservative which we'll
	// also use as a fallback.
	startingScavSleepRatio = 0.001

	// Spend at least 1 ms scavenging, otherwise the corresponding
	// sleep time to maintain our desired utilization is too low to
	// be reliable.
	minScavWorkTime = 1e6
)

// Sleep/wait state of the background scavenger.
var scavenger scavengerState

type scavengerState struct {
	// lock protects all fields below.
	lock mutex

	// g is the goroutine the scavenger is bound to.
	g *g

	// timer is the timer used for the scavenger to sleep.
	timer *timer

	// sysmonWake signals to sysmon that it should wake the scavenger.
	sysmonWake atomic.Uint32

	// parked is whether or not the scavenger is parked.
	parked bool

	// printControllerReset instructs printScavTrace to signal that
	// the controller was reset.
	printControllerReset bool

	// targetCPUFraction is the target CPU overhead for the scavenger.
	targetCPUFraction float64

	// sleepRatio is the ratio of time spent doing scavenging work to
	// time spent sleeping. This is used to decide how long the scavenger
	// should sleep for in between batches of work. It is set by
	// critSleepController in order to maintain a CPU overhead of
	// targetCPUFraction.
	//
	// Lower means more sleep, higher means more aggressive scavenging.
	sleepRatio float64

	// sleepController controls sleepRatio.
	//
	// See sleepRatio for more details.
	sleepController piController

	// controllerCooldown is the time left in nanoseconds during which we avoid
	// using the controller and we hold sleepRatio at a conservative
	// value. Used if the controller's assumptions fail to hold.
	controllerCooldown int64

	// sleepStub is a stub used for testing to avoid actually having
	// the scavenger sleep.
	//
	// Unlike the other stubs, this is not populated if left nil
	// Instead, it is called when non-nil because any valid implementation
	// of this function basically requires closing over this scavenger
	// state, and allocating a closure is not allowed in the runtime as
	// a matter of policy.
	sleepStub func(n int64) int64

	// scavenge is a function that scavenges n bytes of memory.
	// Returns how many bytes of memory it actually scavenged, as
	// well as the time it took in nanoseconds. Usually mheap.pages.scavenge
	// with nanotime called around it, but stubbed out for testing.
	// Like mheap.pages.scavenge, if it scavenges less than n bytes of
	// memory, the caller may assume the heap is exhausted of scavengable
	// memory for now.
	//
	// If this is nil, it is populated with the real thing in init.
	scavenge func(n uintptr) (uintptr, int64)

	// shouldStop is a callback called in the work loop and provides a
	// point that can force the scavenger to stop early, for example because
	// the scavenge policy dictates too much has been scavenged already.
	//
	// If this is nil, it is populated with the real thing in init.
	shouldStop func() bool

	// gomaxprocs returns the current value of gomaxprocs. Stub for testing.
	//
	// If this is nil, it is populated with the real thing in init.
	gomaxprocs func() int32
}

// init initializes a scavenger state and wires to the current G.
//
// Must be called from a regular goroutine that can allocate.
func (s *scavengerState) init() {
	if s.g != nil {
		throw("scavenger state is already wired")
	}
	lockInit(&s.lock, lockRankScavenge)
	s.g = getg()

	s.timer = new(timer)
	f := func(s any, _ uintptr, _ int64) {
		s.(*scavengerState).wake()
	}
	s.timer.init(f, s)

	// input: fraction of CPU time actually used.
	// setpoint: ideal CPU fraction.
	// output: ratio of time worked to time slept (determines sleep time).
	//
	// The output of this controller is somewhat indirect to what we actually
	// want to achieve: how much time to sleep for. The reason for this definition
	// is to ensure that the controller's outputs have a direct relationship with
	// its inputs (as opposed to an inverse relationship), making it somewhat
	// easier to reason about for tuning purposes.
	s.sleepController = piController{
		// Tuned loosely via Ziegler-Nichols process.
		kp: 0.3375,
		ti: 3.2e6,
		tt: 1e9, // 1 second reset time.

		// These ranges seem wide, but we want to give the controller plenty of
		// room to hunt for the optimal value.
		min: 0.001,  // 1:1000
		max: 1000.0, // 1000:1
	}
	s.sleepRatio = startingScavSleepRatio

	// Install real functions if stubs aren't present.
	if s.scavenge == nil {
		s.scavenge = func(n uintptr) (uintptr, int64) {
			start := nanotime()
			r := mheap_.pages.scavenge(n, nil, false)
			end := nanotime()
			if start >= end {
				return r, 0
			}
			scavenge.backgroundTime.Add(end - start)
			return r, end - start
		}
	}
	if s.shouldStop == nil {
		s.shouldStop = func() bool {
			// If background scavenging is disabled or if there's no work to do just stop.
			return heapRetained() <= scavenge.gcPercentGoal.Load() &&
				gcController.mappedReady.Load() <= scavenge.memoryLimitGoal.Load()
		}
	}
	if s.gomaxprocs == nil {
		s.gomaxprocs = func() int32 {
			return gomaxprocs
		}
	}
}

// park parks the scavenger goroutine.
func (s *scavengerState) park() {
	lock(&s.lock)
	if getg() != s.g {
		throw("tried to park scavenger from another goroutine")
	}
	s.parked = true
	goparkunlock(&s.lock, waitReasonGCScavengeWait, traceBlockSystemGoroutine, 2)
}

// ready signals to sysmon that the scavenger should be awoken.
func (s *scavengerState) ready() {
	s.sysmonWake.Store(1)
}

// wake immediately unparks the scavenger if necessary.
//
// Safe to run without a P.
func (s *scavengerState) wake() {
	lock(&s.lock)
	if s.parked {
		// Unset sysmonWake, since the scavenger is now being awoken.
		s.sysmonWake.Store(0)

		// s.parked is unset to prevent a double wake-up.
		s.parked = false

		// Ready the goroutine by injecting it. We use injectglist instead
		// of ready or goready in order to allow us to run this function
		// without a P. injectglist also avoids placing the goroutine in
		// the current P's runnext slot, which is desirable to prevent
		// the scavenger from interfering with user goroutine scheduling
		// too much.
		var list gList
		list.push(s.g)
		injectglist(&list)
	}
	unlock(&s.lock)
}

// sleep puts the scavenger to sleep based on the amount of time that it worked
// in nanoseconds.
//
// Note that this function should only be called by the scavenger.
//
// The scavenger may be woken up earlier by a pacing change, and it may not go
// to sleep at all if there's a pending pacing change.
func (s *scavengerState) sleep(worked float64) {
	lock(&s.lock)
	if getg() != s.g {
		throw("tried to sleep scavenger from another goroutine")
	}

	if worked < minScavWorkTime {
		// This means there wasn't enough work to actually fill up minScavWorkTime.
		// That's fine; we shouldn't try to do anything with this information
		// because it's going result in a short enough sleep request that things
		// will get messy. Just assume we did at least this much work.
		// All this means is that we'll sleep longer than we otherwise would have.
		worked = minScavWorkTime
	}

	// Multiply the critical time by 1 + the ratio of the costs of using
	// scavenged memory vs. scavenging memory. This forces us to pay down
	// the cost of reusing this memory eagerly by sleeping for a longer period
	// of time and scavenging less frequently. More concretely, we avoid situations
	// where we end up scavenging so often that we hurt allocation performance
	// because of the additional overheads of using scavenged memory.
	worked *= 1 + scavengeCostRatio

	// sleepTime is the amount of time we're going to sleep, based on the amount
	// of time we worked, and the sleepRatio.
	sleepTime := int64(worked / s.sleepRatio)

	var slept int64
	if s.sleepStub == nil {
		// Set the timer.
		//
		// This must happen here instead of inside gopark
		// because we can't close over any variables without
		// failing escape analysis.
		start := nanotime()
		s.timer.reset(start+sleepTime, 0)

		// Mark ourselves as asleep and go to sleep.
		s.parked = true
		goparkunlock(&s.lock, waitReasonSleep, traceBlockSleep, 2)

		// How long we actually slept for.
		slept = nanotime() - start

		lock(&s.lock)
		// Stop the timer here because s.wake is unable to do it for us.
		// We don't really care if we succeed in stopping the timer. One
		// reason we might fail is that we've already woken up, but the timer
		// might be in the process of firing on some other P; essentially we're
		// racing with it. That's totally OK. Double wake-ups are perfectly safe.
		s.timer.stop()
		unlock(&s.lock)
	} else {
		unlock(&s.lock)
		slept = s.sleepStub(sleepTime)
	}

	// Stop here if we're cooling down from the controller.
	if s.controllerCooldown > 0 {
		// worked and slept aren't exact measures of time, but it's OK to be a bit
		// sloppy here. We're just hoping we're avoiding some transient bad behavior.
		t := slept + int64(worked)
		if t > s.controllerCooldown {
			s.controllerCooldown = 0
		} else {
			s.controllerCooldown -= t
		}
		return
	}

	// idealFraction is the ideal % of overall application CPU time that we
	// spend scavenging.
	idealFraction := float64(scavengePercent) / 100.0

	// Calculate the CPU time spent.
	//
	// This may be slightly inaccurate with respect to GOMAXPROCS, but we're
	// recomputing this often enough relative to GOMAXPROCS changes in general
	// (it only changes when the world is stopped, and not during a GC) that
	// that small inaccuracy is in the noise.
	cpuFraction := worked / ((float64(slept) + worked) * float64(s.gomaxprocs()))

	// Update the critSleepRatio, adjusting until we reach our ideal fraction.
	var ok bool
	s.sleepRatio, ok = s.sleepController.next(cpuFraction, idealFraction, float64(slept)+worked)
	if !ok {
		// The core assumption of the controller, that we can get a proportional
		// response, broke down. This may be transient, so temporarily switch to
		// sleeping a fixed, conservative amount.
		s.sleepRatio = startingScavSleepRatio
		s.controllerCooldown = 5e9 // 5 seconds.

		// Signal the scav trace printer to output this.
		s.controllerFailed()
	}
}

// controllerFailed indicates that the scavenger's scheduling
// controller failed.
func (s *scavengerState) controllerFailed() {
	lock(&s.lock)
	s.printControllerReset = true
	unlock(&s.lock)
}

// run is the body of the main scavenging loop.
//
// Returns the number of bytes released and the estimated time spent
// releasing those bytes.
//
// Must be run on the scavenger goroutine.
func (s *scavengerState) run() (released uintptr, worked float64) {
	lock(&s.lock)
	if getg() != s.g {
		throw("tried to run scavenger from another goroutine")
	}
	unlock(&s.lock)

	for worked < minScavWorkTime {
		// If something from outside tells us to stop early, stop.
		if s.shouldStop() {
			break
		}

		// scavengeQuantum is the amount of memory we try to scavenge
		// in one go. A smaller value means the scavenger is more responsive
		// to the scheduler in case of e.g. preemption. A larger value means
		// that the overheads of scavenging are better amortized, so better
		// scavenging throughput.
		//
		// The current value is chosen assuming a cost of ~10µs/physical page
		// (this is somewhat pessimistic), which implies a worst-case latency of
		// about 160µs for 4 KiB physical pages. The current value is biased
		// toward latency over throughput.
		const scavengeQuantum = 64 << 10

		// Accumulate the amount of time spent scavenging.
		r, duration := s.scavenge(scavengeQuantum)

		// On some platforms we may see end >= start if the time it takes to scavenge
		// memory is less than the minimum granularity of its clock (e.g. Windows) or
		// due to clock bugs.
		//
		// In this case, just assume scavenging takes 10 µs per regular physical page
		// (determined empirically), and conservatively ignore the impact of huge pages
		// on timing.
		const approxWorkedNSPerPhysicalPage = 10e3
		if duration == 0 {
			worked += approxWorkedNSPerPhysicalPage * float64(r/physPageSize)
		} else {
			// TODO(mknyszek): If duration is small compared to worked, it could be
			// rounded down to zero. Probably not a problem in practice because the
			// values are all within a few orders of magnitude of each other but maybe
			// worth worrying about.
			worked += float64(duration)
		}
		released += r

		// scavenge does not return until it either finds the requisite amount of
		// memory to scavenge, or exhausts the heap. If we haven't found enough
		// to scavenge, then the heap must be exhausted.
		if r < scavengeQuantum {
			break
		}
		// When using fake time just do one loop.
		if faketime != 0 {
			break
		}
	}
	if released > 0 && released < physPageSize {
		// If this happens, it means that we may have attempted to release part
		// of a physical page, but the likely effect of that is that it released
		// the whole physical page, some of which may have still been in-use.
		// This could lead to memory corruption. Throw.
		throw("released less than one physical page of memory")
	}
	return
}

// Background scavenger.
//
// The background scavenger maintains the RSS of the application below
// the line described by the proportional scavenging statistics in
// the mheap struct.
func bgscavenge(c chan int) {
	scavenger.init()

	c <- 1
	scavenger.park()

	for {
		released, workTime := scavenger.run()
		if released == 0 {
			scavenger.park()
			continue
		}
		mheap_.pages.scav.releasedBg.Add(released)
		scavenger.sleep(workTime)
	}
}

// scavenge scavenges nbytes worth of free pages, starting with the
// highest address first. Successive calls continue from where it left
// off until the heap is exhausted. force makes all memory available to
// scavenge, ignoring huge page heuristics.
//
// Returns the amount of memory scavenged in bytes.
//
// scavenge always tries to scavenge nbytes worth of memory, and will
// only fail to do so if the heap is exhausted for now.
func (p *pageAlloc) scavenge(nbytes uintptr, shouldStop func() bool, force bool) uintptr {
	released := uintptr(0)
	for released < nbytes {
		ci, pageIdx := p.scav.index.find(force)
		if ci == 0 {
			break
		}
		systemstack(func() {
			released += p.scavengeOne(ci, pageIdx, nbytes-released)
		})
		if shouldStop != nil && shouldStop() {
			break
		}
	}
	return released
}

// printScavTrace prints a scavenge trace line to standard error.
//
// released should be the amount of memory released since the last time this
// was called, and forced indicates whether the scavenge was forced by the
// application.
//
// scavenger.lock must be held.
func printScavTrace(releasedBg, releasedEager uintptr, forced bool) {
	assertLockHeld(&scavenger.lock)

	printlock()
	print("scav ",
		releasedBg>>10, " KiB work (bg), ",
		releasedEager>>10, " KiB work (eager), ",
		gcController.heapReleased.load()>>10, " KiB now, ",
		(gcController.heapInUse.load()*100)/heapRetained(), "% util",
	)
	if forced {
		print(" (forced)")
	} else if scavenger.printControllerReset {
		print(" [controller reset]")
		scavenger.printControllerReset = false
	}
	println()
	printunlock()
}

// scavengeOne walks over the chunk at chunk index ci and searches for
// a contiguous run of pages to scavenge. It will try to scavenge
// at most max bytes at once, but may scavenge more to avoid
// breaking huge pages. Once it scavenges some memory it returns
// how much it scavenged in bytes.
//
// searchIdx is the page index to start searching from in ci.
//
// Returns the number of bytes scavenged.
//
// Must run on the systemstack because it acquires p.mheapLock.
//
//go:systemstack
func (p *pageAlloc) scavengeOne(ci chunkIdx, searchIdx uint, max uintptr) uintptr {
	// Calculate the maximum number of pages to scavenge.
	//
	// This should be alignUp(max, pageSize) / pageSize but max can and will
	// be ^uintptr(0), so we need to be very careful not to overflow here.
	// Rather than use alignUp, calculate the number of pages rounded down
	// first, then add back one if necessary.
	maxPages := max / pageSize
	if max%pageSize != 0 {
		maxPages++
	}

	// Calculate the minimum number of pages we can scavenge.
	//
	// Because we can only scavenge whole physical pages, we must
	// ensure that we scavenge at least minPages each time, aligned
	// to minPages*pageSize.
	minPages := physPageSize / pageSize
	if minPages < 1 {
		minPages = 1
	}

	lock(p.mheapLock)
	if p.summary[len(p.summary)-1][ci].max() >= uint(minPages) {
		// We only bother looking for a candidate if there at least
		// minPages free pages at all.
		base, npages := p.chunkOf(ci).findScavengeCandidate(searchIdx, minPages, maxPages)

		// If we found something, scavenge it and return!
		if npages != 0 {
			// Compute the full address for the start of the range.
			addr := chunkBase(ci) + uintptr(base)*pageSize

			// Mark the range we're about to scavenge as allocated, because
			// we don't want any allocating goroutines to grab it while
			// the scavenging is in progress. Be careful here -- just do the
			// bare minimum to avoid stepping on our own scavenging stats.
			p.chunkOf(ci).allocRange(base, npages)
			p.update(addr, uintptr(npages), true, true)

			// With that done, it's safe to unlock.
			unlock(p.mheapLock)

			if !p.test {
				// Only perform sys* operations if we're not in a test.
				// It's dangerous to do so otherwise.
				sysUnused(unsafe.Pointer(addr), uintptr(npages)*pageSize)

				// Update global accounting only when not in test, otherwise
				// the runtime's accounting will be wrong.
				nbytes := int64(npages * pageSize)
				gcController.heapReleased.add(nbytes)
				gcController.heapFree.add(-nbytes)

				stats := memstats.heapStats.acquire()
				atomic.Xaddint64(&stats.committed, -nbytes)
				atomic.Xaddint64(&stats.released, nbytes)
				memstats.heapStats.release()
			}

			// Relock the heap, because now we need to make these pages
			// available allocation. Free them back to the page allocator.
			lock(p.mheapLock)
			if b := (offAddr{addr}); b.lessThan(p.searchAddr) {
				p.searchAddr = b
			}
			p.chunkOf(ci).free(base, npages)
			p.update(addr, uintptr(npages), true, false)

			// Mark the range as scavenged.
			p.chunkOf(ci).scavenged.setRange(base, npages)
			unlock(p.mheapLock)

			return uintptr(npages) * pageSize
		}
	}
	// Mark this chunk as having no free pages.
	p.scav.index.setEmpty(ci)
	unlock(p.mheapLock)

	return 0
}

// fillAligned returns x but with all zeroes in m-aligned
// groups of m bits set to 1 if any bit in the group is non-zero.
//
// For example, fillAligned(0x0100a3, 8) == 0xff00ff.
//
// Note that if m == 1, this is a no-op.
//
// m must be a power of 2 <= maxPagesPerPhysPage.
func fillAligned(x uint64, m uint) uint64 {
	apply := func(x uint64, c uint64) uint64 {
		// The technique used it here is derived from
		// https://graphics.stanford.edu/~seander/bithacks.html#ZeroInWord
		// and extended for more than just bytes (like nibbles
		// and uint16s) by using an appropriate constant.
		//
		// To summarize the technique, quoting from that page:
		// "[It] works by first zeroing the high bits of the [8]
		// bytes in the word. Subsequently, it adds a number that
		// will result in an overflow to the high bit of a byte if
		// any of the low bits were initially set. Next the high
		// bits of the original word are ORed with these values;
		// thus, the high bit of a byte is set iff any bit in the
		// byte was set. Finally, we determine if any of these high
		// bits are zero by ORing with ones everywhere except the
		// high bits and inverting the result."
		return ^((((x & c) + c) | x) | c)
	}
	// Transform x to contain a 1 bit at the top of each m-aligned
	// group of m zero bits.
	switch m {
	case 1:
		return x
	case 2:
		x = apply(x, 0x5555555555555555)
	case 4:
		x = apply(x, 0x7777777777777777)
	case 8:
		x = apply(x, 0x7f7f7f7f7f7f7f7f)
	case 16:
		x = apply(x, 0x7fff7fff7fff7fff)
	case 32:
		x = apply(x, 0x7fffffff7fffffff)
	case 64: // == maxPagesPerPhysPage
		x = apply(x, 0x7fffffffffffffff)
	default:
		throw("bad m value")
	}
	// Now, the top bit of each m-aligned group in x is set
	// that group was all zero in the original x.

	// From each group of m bits subtract 1.
	// Because we know only the top bits of each
	// m-aligned group are set, we know this will
	// set each group to have all the bits set except
	// the top bit, so just OR with the original
	// result to set all the bits.
	return ^((x - (x >> (m - 1))) | x)
}

// findScavengeCandidate returns a start index and a size for this pallocData
// segment which represents a contiguous region of free and unscavenged memory.
//
// searchIdx indicates the page index within this chunk to start the search, but
// note that findScavengeCandidate searches backwards through the pallocData. As
// a result, it will return the highest scavenge candidate in address order.
//
// min indicates a hard minimum size and alignment for runs of pages. That is,
// findScavengeCandidate will not return a region smaller than min pages in size,
// or that is min pages or greater in size but not aligned to min. min must be
// a non-zero power of 2 <= maxPagesPerPhysPage.
//
// max is a hint for how big of a region is desired. If max >= pallocChunkPages, then
// findScavengeCandidate effectively returns entire free and unscavenged regions.
// If max < pallocChunkPages, it may truncate the returned region such that size is
// max. However, findScavengeCandidate may still return a larger region if, for
// example, it chooses to preserve huge pages, or if max is not aligned to min (it
// will round up). That is, even if max is small, the returned size is not guaranteed
// to be equal to max. max is allowed to be less than min, in which case it is as if
// max == min.
func (m *pallocData) findScavengeCandidate(searchIdx uint, minimum, max uintptr) (uint, uint) {
	if minimum&(minimum-1) != 0 || minimum == 0 {
		print("runtime: min = ", minimum, "\n")
		throw("min must be a non-zero power of 2")
	} else if minimum > maxPagesPerPhysPage {
		print("runtime: min = ", minimum, "\n")
		throw("min too large")
	}
	// max may not be min-aligned, so we might accidentally truncate to
	// a max value which causes us to return a non-min-aligned value.
	// To prevent this, align max up to a multiple of min (which is always
	// a power of 2). This also prevents max from ever being less than
	// min, unless it's zero, so handle that explicitly.
	if max == 0 {
		max = minimum
	} else {
		max = alignUp(max, minimum)
	}

	i := int(searchIdx / 64)
	// Start by quickly skipping over blocks of non-free or scavenged pages.
	for ; i >= 0; i-- {
		// 1s are scavenged OR non-free => 0s are unscavenged AND free
		x := fillAligned(m.scavenged[i]|m.pallocBits[i], uint(minimum))
		if x != ^uint64(0) {
			break
		}
	}
	if i < 0 {
		// Failed to find any free/unscavenged pages.
		return 0, 0
	}
	// We have something in the 64-bit chunk at i, but it could
	// extend further. Loop until we find the extent of it.

	// 1s are scavenged OR non-free => 0s are unscavenged AND free
	x := fillAligned(m.scavenged[i]|m.pallocBits[i], uint(minimum))
	z1 := uint(sys.LeadingZeros64(^x))
	run, end := uint(0), uint(i)*64+(64-z1)
	if x<<z1 != 0 {
		// After shifting out z1 bits, we still have 1s,
		// so the run ends inside this word.
		run = uint(sys.LeadingZeros64(x << z1))
	} else {
		// After shifting out z1 bits, we have no more 1s.
		// This means the run extends to the bottom of the
		// word so it may extend into further words.
		run = 64 - z1
		for j := i - 1; j >= 0; j-- {
			x := fillAligned(m.scavenged[j]|m.pallocBits[j], uint(minimum))
			run += uint(sys.LeadingZeros64(x))
			if x != 0 {
				// The run stopped in this word.
				break
			}
		}
	}

	// Split the run we found if it's larger than max but hold on to
	// our original length, since we may need it later.
	size := min(run, uint(max))
	start := end - size

	// Each huge page is guaranteed to fit in a single palloc chunk.
	//
	// TODO(mknyszek): Support larger huge page sizes.
	// TODO(mknyszek): Consider taking pages-per-huge-page as a parameter
	// so we can write tests for this.
	if physHugePageSize > pageSize && physHugePageSize > physPageSize {
		// We have huge pages, so let's ensure we don't break one by scavenging
		// over a huge page boundary. If the range [start, start+size) overlaps with
		// a free-and-unscavenged huge page, we want to grow the region we scavenge
		// to include that huge page.

		// Compute the huge page boundary above our candidate.
		pagesPerHugePage := physHugePageSize / pageSize
		hugePageAbove := uint(alignUp(uintptr(start), pagesPerHugePage))

		// If that boundary is within our current candidate, then we may be breaking
		// a huge page.
		if hugePageAbove <= end {
			// Compute the huge page boundary below our candidate.
			hugePageBelow := uint(alignDown(uintptr(start), pagesPerHugePage))

			if hugePageBelow >= end-run {
				// We're in danger of breaking apart a huge page since start+size crosses
				// a huge page boundary and rounding down start to the nearest huge
				// page boundary is included in the full run we found. Include the entire
				// huge page in the bound by rounding down to the huge page size.
				size = size + (start - hugePageBelow)
				start = hugePageBelow
			}
		}
	}
	return start, size
}

// scavengeIndex is a structure for efficiently managing which pageAlloc chunks have
// memory available to scavenge.
type scavengeIndex struct {
	// chunks is a scavChunkData-per-chunk structure that indicates the presence of pages
	// available for scavenging. Updates to the index are serialized by the pageAlloc lock.
	//
	// It tracks chunk occupancy and a generation counter per chunk. If a chunk's occupancy
	// never exceeds pallocChunkDensePages over the course of a single GC cycle, the chunk
	// becomes eligible for scavenging on the next cycle. If a chunk ever hits this density
	// threshold it immediately becomes unavailable for scavenging in the current cycle as
	// well as the next.
	//
	// [min, max) represents the range of chunks that is safe to access (i.e. will not cause
	// a fault). As an optimization minHeapIdx represents the true minimum chunk that has been
	// mapped, since min is likely rounded down to include the system page containing minHeapIdx.
	//
	// For a chunk size of 4 MiB this structure will only use 2 MiB for a 1 TiB contiguous heap.
	chunks     []atomicScavChunkData
	min, max   atomic.Uintptr
	minHeapIdx atomic.Uintptr

	// searchAddr* is the maximum address (in the offset address space, so we have a linear
	// view of the address space; see mranges.go:offAddr) containing memory available to
	// scavenge. It is a hint to the find operation to avoid O(n^2) behavior in repeated lookups.
	//
	// searchAddr* is always inclusive and should be the base address of the highest runtime
	// page available for scavenging.
	//
	// searchAddrForce is managed by find and free.
	// searchAddrBg is managed by find and nextGen.
	//
	// Normally, find monotonically decreases searchAddr* as it finds no more free pages to
	// scavenge. However, mark, when marking a new chunk at an index greater than the current
	// searchAddr, sets searchAddr to the *negative* index into chunks of that page. The trick here
	// is that concurrent calls to find will fail to monotonically decrease searchAddr*, and so they
	// won't barge over new memory becoming available to scavenge. Furthermore, this ensures
	// that some future caller of find *must* observe the new high index. That caller
	// (or any other racing with it), then makes searchAddr positive before continuing, bringing
	// us back to our monotonically decreasing steady-state.
	//
	// A pageAlloc lock serializes updates between min, max, and searchAddr, so abs(searchAddr)
	// is always guaranteed to be >= min and < max (converted to heap addresses).
	//
	// searchAddrBg is increased only on each new generation and is mainly used by the
	// background scavenger and heap-growth scavenging. searchAddrForce is increased continuously
	// as memory gets freed and is mainly used by eager memory reclaim such as debug.FreeOSMemory
	// and scavenging to maintain the memory limit.
	searchAddrBg    atomicOffAddr
	searchAddrForce atomicOffAddr

	// freeHWM is the highest address (in offset address space) that was freed
	// this generation.
	freeHWM offAddr

	// Generation counter. Updated by nextGen at the end of each mark phase.
	gen uint32

	// test indicates whether or not we're in a test.
	test bool
}

// init initializes the scavengeIndex.
//
// Returns the amount added to sysStat.
func (s *scavengeIndex) init(test bool, sysStat *sysMemStat) uintptr {
	s.searchAddrBg.Clear()
	s.searchAddrForce.Clear()
	s.freeHWM = minOffAddr
	s.test = test
	return s.sysInit(test, sysStat)
}

// sysGrow updates the index's backing store in response to a heap growth.
//
// Returns the amount of memory added to sysStat.
func (s *scavengeIndex) grow(base, limit uintptr, sysStat *sysMemStat) uintptr {
	// Update minHeapIdx. Note that even if there's no mapping work to do,
	// we may still have a new, lower minimum heap address.
	minHeapIdx := s.minHeapIdx.Load()
	if baseIdx := uintptr(chunkIndex(base)); minHeapIdx == 0 || baseIdx < minHeapIdx {
		s.minHeapIdx.Store(baseIdx)
	}
	return s.sysGrow(base, limit, sysStat)
}

// find returns the highest chunk index that may contain pages available to scavenge.
// It also returns an offset to start searching in the highest chunk.
func (s *scavengeIndex) find(force bool) (chunkIdx, uint) {
	cursor := &s.searchAddrBg
	if force {
		cursor = &s.searchAddrForce
	}
	searchAddr, marked := cursor.Load()
	if searchAddr == minOffAddr.addr() {
		// We got a cleared search addr.
		return 0, 0
	}

	// Starting from searchAddr's chunk, iterate until we find a chunk with pages to scavenge.
	gen := s.gen
	min := chunkIdx(s.minHeapIdx.Load())
	start := chunkIndex(searchAddr)
	// N.B. We'll never map the 0'th chunk, so minHeapIdx ensures this loop overflow.
	for i := start; i >= min; i-- {
		// Skip over chunks.
		if !s.chunks[i].load().shouldScavenge(gen, force) {
			continue
		}
		// We're still scavenging this chunk.
		if i == start {
			return i, chunkPageIndex(searchAddr)
		}
		// Try to reduce searchAddr to newSearchAddr.
		newSearchAddr := chunkBase(i) + pallocChunkBytes - pageSize
		if marked {
			// Attempt to be the first one to decrease the searchAddr
			// after an increase. If we fail, that means there was another
			// increase, or somebody else got to it before us. Either way,
			// it doesn't matter. We may lose some performance having an
			// incorrect search address, but it's far more important that
			// we don't miss updates.
			cursor.StoreUnmark(searchAddr, newSearchAddr)
		} else {
			// Decrease searchAddr.
			cursor.StoreMin(newSearchAddr)
		}
		return i, pallocChunkPages - 1
	}
	// Clear searchAddr, because we've exhausted the heap.
	cursor.Clear()
	return 0, 0
}

// alloc updates metadata for chunk at index ci with the fact that
// an allocation of npages occurred. It also eagerly attempts to collapse
// the chunk's memory into hugepage if the chunk has become sufficiently
// dense and we're not allocating the whole chunk at once (which suggests
// the allocation is part of a bigger one and it's probably not worth
// eagerly collapsing).
//
// alloc may only run concurrently with find.
func (s *scavengeIndex) alloc(ci chunkIdx, npages uint) {
	sc := s.chunks[ci].load()
	sc.alloc(npages, s.gen)
	// TODO(mknyszek): Consider eagerly backing memory with huge pages
	// here and track whether we believe this chunk is backed by huge pages.
	// In the past we've attempted to use sysHugePageCollapse (which uses
	// MADV_COLLAPSE on Linux, and is unsupported elswhere) for this purpose,
	// but that caused performance issues in production environments.
	s.chunks[ci].store(sc)
}

// free updates metadata for chunk at index ci with the fact that
// a free of npages occurred.
//
// free may only run concurrently with find.
func (s *scavengeIndex) free(ci chunkIdx, page, npages uint) {
	sc := s.chunks[ci].load()
	sc.free(npages, s.gen)
	s.chunks[ci].store(sc)

	// Update scavenge search addresses.
	addr := chunkBase(ci) + uintptr(page+npages-1)*pageSize
	if s.freeHWM.lessThan(offAddr{addr}) {
		s.freeHWM = offAddr{addr}
	}
	// N.B. Because free is serialized, it's not necessary to do a
	// full CAS here. free only ever increases searchAddr, while
	// find only ever decreases it. Since we only ever race with
	// decreases, even if the value we loaded is stale, the actual
	// value will never be larger.
	searchAddr, _ := s.searchAddrForce.Load()
	if (offAddr{searchAddr}).lessThan(offAddr{addr}) {
		s.searchAddrForce.StoreMarked(addr)
	}
}

// nextGen moves the scavenger forward one generation. Must be called
// once per GC cycle, but may be called more often to force more memory
// to be released.
//
// nextGen may only run concurrently with find.
func (s *scavengeIndex) nextGen() {
	s.gen++
	searchAddr, _ := s.searchAddrBg.Load()
	if (offAddr{searchAddr}).lessThan(s.freeHWM) {
		s.searchAddrBg.StoreMarked(s.freeHWM.addr())
	}
	s.freeHWM = minOffAddr
}

// setEmpty marks that the scavenger has finished looking at ci
// for now to prevent the scavenger from getting stuck looking
// at the same chunk.
//
// setEmpty may only run concurrently with find.
func (s *scavengeIndex) setEmpty(ci chunkIdx) {
	val := s.chunks[ci].load()
	val.setEmpty()
	s.chunks[ci].store(val)
}

// atomicScavChunkData is an atomic wrapper around a scavChunkData
// that stores it in its packed form.
type atomicScavChunkData struct {
	value atomic.Uint64
}

// load loads and unpacks a scavChunkData.
func (sc *atomicScavChunkData) load() scavChunkData {
	return unpackScavChunkData(sc.value.Load())
}

// store packs and writes a new scavChunkData. store must be serialized
// with other calls to store.
func (sc *atomicScavChunkData) store(ssc scavChunkData) {
	sc.value.Store(ssc.pack())
}

// scavChunkData tracks information about a palloc chunk for
// scavenging. It packs well into 64 bits.
//
// The zero value always represents a valid newly-grown chunk.
type scavChunkData struct {
	// inUse indicates how many pages in this chunk are currently
	// allocated.
	//
	// Only the first 10 bits are used.
	inUse uint16

	// lastInUse indicates how many pages in this chunk were allocated
	// when we transitioned from gen-1 to gen.
	//
	// Only the first 10 bits are used.
	lastInUse uint16

	// gen is the generation counter from a scavengeIndex from the
	// last time this scavChunkData was updated.
	gen uint32

	// scavChunkFlags represents additional flags
	//
	// Note: only 6 bits are available.
	scavChunkFlags
}

// unpackScavChunkData unpacks a scavChunkData from a uint64.
func unpackScavChunkData(sc uint64) scavChunkData {
	return scavChunkData{
		inUse:          uint16(sc),
		lastInUse:      uint16(sc>>16) & scavChunkInUseMask,
		gen:            uint32(sc >> 32),
		scavChunkFlags: scavChunkFlags(uint8(sc>>(16+logScavChunkInUseMax)) & scavChunkFlagsMask),
	}
}

// pack returns sc packed into a uint64.
func (sc scavChunkData) pack() uint64 {
	return uint64(sc.inUse) |
		(uint64(sc.lastInUse) << 16) |
		(uint64(sc.scavChunkFlags) << (16 + logScavChunkInUseMax)) |
		(uint64(sc.gen) << 32)
}

const (
	// scavChunkHasFree indicates whether the chunk has anything left to
	// scavenge. This is the opposite of "empty," used elsewhere in this
	// file. The reason we say "HasFree" here is so the zero value is
	// correct for a newly-grown chunk. (New memory is scavenged.)
	scavChunkHasFree scavChunkFlags = 1 << iota

	// scavChunkMaxFlags is the maximum number of flags we can have, given how
	// a scavChunkData is packed into 8 bytes.
	scavChunkMaxFlags  = 6
	scavChunkFlagsMask = (1 << scavChunkMaxFlags) - 1

	// logScavChunkInUseMax is the number of bits needed to represent the number
	// of pages allocated in a single chunk. This is 1 more than log2 of the
	// number of pages in the chunk because we need to represent a fully-allocated
	// chunk.
	logScavChunkInUseMax = logPallocChunkPages + 1
	scavChunkInUseMask   = (1 << logScavChunkInUseMax) - 1
)

// scavChunkFlags is a set of bit-flags for the scavenger for each palloc chunk.
type scavChunkFlags uint8

// isEmpty returns true if the hasFree flag is unset.
func (sc *scavChunkFlags) isEmpty() bool {
	return (*sc)&scavChunkHasFree == 0
}

// setEmpty clears the hasFree flag.
func (sc *scavChunkFlags) setEmpty() {
	*sc &^= scavChunkHasFree
}

// setNonEmpty sets the hasFree flag.
func (sc *scavChunkFlags) setNonEmpty() {
	*sc |= scavChunkHasFree
}

// shouldScavenge returns true if the corresponding chunk should be interrogated
// by the scavenger.
func (sc scavChunkData) shouldScavenge(currGen uint32, force bool) bool {
	if sc.isEmpty() {
		// Nothing to scavenge.
		return false
	}
	if force {
		// We're forcing the memory to be scavenged.
		return true
	}
	if sc.gen == currGen {
		// In the current generation, if either the current or last generation
		// is dense, then skip scavenging. Inverting that, we should scavenge
		// if both the current and last generation were not dense.
		return sc.inUse < scavChunkHiOccPages && sc.lastInUse < scavChunkHiOccPages
	}
	// If we're one or more generations ahead, we know inUse represents the current
	// state of the chunk, since otherwise it would've been updated already.
	return sc.inUse < scavChunkHiOccPages
}

// alloc updates sc given that npages were allocated in the corresponding chunk.
func (sc *scavChunkData) alloc(npages uint, newGen uint32) {
	if uint(sc.inUse)+npages > pallocChunkPages {
		print("runtime: inUse=", sc.inUse, " npages=", npages, "\n")
		throw("too many pages allocated in chunk?")
	}
	if sc.gen != newGen {
		sc.lastInUse = sc.inUse
		sc.gen = newGen
	}
	sc.inUse += uint16(npages)
	if sc.inUse == pallocChunkPages {
		// There's nothing for the scavenger to take from here.
		sc.setEmpty()
	}
}

// free updates sc given that npages was freed in the corresponding chunk.
func (sc *scavChunkData) free(npages uint, newGen uint32) {
	if uint(sc.inUse) < npages {
		print("runtime: inUse=", sc.inUse, " npages=", npages, "\n")
		throw("allocated pages below zero?")
	}
	if sc.gen != newGen {
		sc.lastInUse = sc.inUse
		sc.gen = newGen
	}
	sc.inUse -= uint16(npages)
	// The scavenger can no longer be done with this chunk now that
	// new memory has been freed into it.
	sc.setNonEmpty()
}

type piController struct {
	kp float64 // Proportional constant.
	ti float64 // Integral time constant.
	tt float64 // Reset time.

	min, max float64 // Output boundaries.

	// PI controller state.

	errIntegral float64 // Integral of the error from t=0 to now.

	// Error flags.
	errOverflow   bool // Set if errIntegral ever overflowed.
	inputOverflow bool // Set if an operation with the input overflowed.
}

// next provides a new sample to the controller.
//
// input is the sample, setpoint is the desired point, and period is how much
// time (in whatever unit makes the most sense) has passed since the last sample.
//
// Returns a new value for the variable it's controlling, and whether the operation
// completed successfully. One reason this might fail is if error has been growing
// in an unbounded manner, to the point of overflow.
//
// In the specific case of an error overflow occurs, the errOverflow field will be
// set and the rest of the controller's internal state will be fully reset.
func (c *piController) next(input, setpoint, period float64) (float64, bool) {
	// Compute the raw output value.
	prop := c.kp * (setpoint - input)
	rawOutput := prop + c.errIntegral

	// Clamp rawOutput into output.
	output := rawOutput
	if isInf(output) || isNaN(output) {
		// The input had a large enough magnitude that either it was already
		// overflowed, or some operation with it overflowed.
		// Set a flag and reset. That's the safest thing to do.
		c.reset()
		c.inputOverflow = true
		return c.min, false
	}
	if output < c.min {
		output = c.min
	} else if output > c.max {
		output = c.max
	}

	// Update the controller's state.
	if c.ti != 0 && c.tt != 0 {
		c.errIntegral += (c.kp*period/c.ti)*(setpoint-input) + (period/c.tt)*(output-rawOutput)
		if isInf(c.errIntegral) || isNaN(c.errIntegral) {
			// So much error has accumulated that we managed to overflow.
			// The assumptions around the controller have likely broken down.
			// Set a flag and reset. That's the safest thing to do.
			c.reset()
			c.errOverflow = true
			return c.min, false
		}
	}
	return output, true
}

// reset resets the controller state, except for controller error flags.
func (c *piController) reset() {
	c.errIntegral = 0
}

Current_dir [ NOT WRITEABLE ] Document_root [ WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
16 Dec 2025 9.30 PM
root / root
0755
asan
--
16 Dec 2025 9.30 PM
root / root
0755
cgo
--
16 Dec 2025 9.30 PM
root / root
0755
coverage
--
16 Dec 2025 9.30 PM
root / root
0755
debug
--
16 Dec 2025 9.30 PM
root / root
0755
metrics
--
16 Dec 2025 9.30 PM
root / root
0755
msan
--
16 Dec 2025 9.30 PM
root / root
0755
pprof
--
16 Dec 2025 9.30 PM
root / root
0755
race
--
16 Dec 2025 9.34 PM
root / root
0755
trace
--
16 Dec 2025 9.30 PM
root / root
0755
HACKING.md
16.996 KB
4 Dec 2025 6.06 PM
root / root
0644
Makefile
0.174 KB
4 Dec 2025 6.06 PM
root / root
0644
alg.go
11.129 KB
4 Dec 2025 6.06 PM
root / root
0644
arena.go
38.046 KB
4 Dec 2025 6.06 PM
root / root
0644
asan.go
1.998 KB
4 Dec 2025 6.06 PM
root / root
0644
asan0.go
0.989 KB
4 Dec 2025 6.06 PM
root / root
0644
asan_amd64.s
3.342 KB
4 Dec 2025 6.06 PM
root / root
0644
asan_arm64.s
3.04 KB
4 Dec 2025 6.06 PM
root / root
0644
asan_loong64.s
3.013 KB
4 Dec 2025 6.06 PM
root / root
0644
asan_ppc64le.s
3.625 KB
4 Dec 2025 6.06 PM
root / root
0644
asan_riscv64.s
2.789 KB
4 Dec 2025 6.06 PM
root / root
0644
asm.s
0.377 KB
4 Dec 2025 6.06 PM
root / root
0644
asm_386.s
42.975 KB
4 Dec 2025 6.06 PM
root / root
0644
asm_amd64.h
0.616 KB
4 Dec 2025 6.06 PM
root / root
0644
asm_amd64.s
60.331 KB
4 Dec 2025 6.06 PM
root / root
0644
asm_arm.s
31.931 KB
4 Dec 2025 6.06 PM
root / root
0644
asm_arm64.s
44.624 KB
4 Dec 2025 6.06 PM
root / root
0644
asm_loong64.s
34.597 KB
4 Dec 2025 6.06 PM
root / root
0644
asm_mips64x.s
24.202 KB
4 Dec 2025 6.06 PM
root / root
0644
asm_mipsx.s
26.186 KB
4 Dec 2025 6.06 PM
root / root
0644
asm_ppc64x.h
1.933 KB
4 Dec 2025 6.06 PM
root / root
0644
asm_ppc64x.s
45.254 KB
4 Dec 2025 6.06 PM
root / root
0644
asm_riscv64.h
0.522 KB
4 Dec 2025 6.06 PM
root / root
0644
asm_riscv64.s
27.11 KB
4 Dec 2025 6.06 PM
root / root
0644
asm_s390x.s
27.919 KB
4 Dec 2025 6.06 PM
root / root
0644
asm_wasm.s
13.101 KB
4 Dec 2025 6.06 PM
root / root
0644
atomic_arm64.s
0.253 KB
4 Dec 2025 6.06 PM
root / root
0644
atomic_loong64.s
0.267 KB
4 Dec 2025 6.06 PM
root / root
0644
atomic_mips64x.s
0.293 KB
4 Dec 2025 6.06 PM
root / root
0644
atomic_mipsx.s
0.256 KB
4 Dec 2025 6.06 PM
root / root
0644
atomic_pointer.go
3.979 KB
4 Dec 2025 6.06 PM
root / root
0644
atomic_ppc64x.s
0.427 KB
4 Dec 2025 6.06 PM
root / root
0644
atomic_riscv64.s
0.269 KB
4 Dec 2025 6.06 PM
root / root
0644
auxv_none.go
0.291 KB
4 Dec 2025 6.06 PM
root / root
0644
badlinkname.go
0.646 KB
4 Dec 2025 6.06 PM
root / root
0644
badlinkname_linux.go
0.494 KB
4 Dec 2025 6.06 PM
root / root
0644
cgo.go
3.613 KB
4 Dec 2025 6.06 PM
root / root
0644
cgo_mmap.go
2.423 KB
4 Dec 2025 6.06 PM
root / root
0644
cgo_ppc64x.go
0.408 KB
4 Dec 2025 6.06 PM
root / root
0644
cgo_sigaction.go
3.273 KB
4 Dec 2025 6.06 PM
root / root
0644
cgocall.go
25.173 KB
4 Dec 2025 6.06 PM
root / root
0644
cgocallback.go
0.31 KB
4 Dec 2025 6.06 PM
root / root
0644
cgocheck.go
5.46 KB
4 Dec 2025 6.06 PM
root / root
0644
cgroup_linux.go
3.582 KB
4 Dec 2025 6.06 PM
root / root
0644
cgroup_stubs.go
0.591 KB
4 Dec 2025 6.06 PM
root / root
0644
chan.go
26.842 KB
4 Dec 2025 6.06 PM
root / root
0644
checkptr.go
3.574 KB
4 Dec 2025 6.06 PM
root / root
0644
compiler.go
0.4 KB
4 Dec 2025 6.06 PM
root / root
0644
complex.go
1.591 KB
4 Dec 2025 6.06 PM
root / root
0644
coro.go
8.315 KB
4 Dec 2025 6.06 PM
root / root
0644
covercounter.go
0.723 KB
4 Dec 2025 6.06 PM
root / root
0644
covermeta.go
0.589 KB
4 Dec 2025 6.06 PM
root / root
0644
cpuflags.go
0.999 KB
4 Dec 2025 6.06 PM
root / root
0644
cpuflags_amd64.go
1.092 KB
4 Dec 2025 6.06 PM
root / root
0644
cpuflags_arm64.go
0.305 KB
4 Dec 2025 6.06 PM
root / root
0644
cpuprof.go
8.523 KB
4 Dec 2025 6.06 PM
root / root
0644
cputicks.go
0.427 KB
4 Dec 2025 6.06 PM
root / root
0644
create_file_nounix.go
0.298 KB
4 Dec 2025 6.06 PM
root / root
0644
create_file_unix.go
0.359 KB
4 Dec 2025 6.06 PM
root / root
0644
debug.go
8.235 KB
4 Dec 2025 6.06 PM
root / root
0644
debugcall.go
7.132 KB
4 Dec 2025 6.06 PM
root / root
0644
debuglog.go
20.045 KB
4 Dec 2025 6.06 PM
root / root
0644
debuglog_off.go
0.432 KB
4 Dec 2025 6.06 PM
root / root
0644
debuglog_on.go
1.441 KB
4 Dec 2025 6.06 PM
root / root
0644
defs1_linux.go
0.825 KB
4 Dec 2025 6.06 PM
root / root
0644
defs1_netbsd_386.go
2.999 KB
4 Dec 2025 6.06 PM
root / root
0644
defs1_netbsd_amd64.go
3.229 KB
4 Dec 2025 6.06 PM
root / root
0644
defs1_netbsd_arm.go
3.116 KB
4 Dec 2025 6.06 PM
root / root
0644
defs1_netbsd_arm64.go
3.341 KB
4 Dec 2025 6.06 PM
root / root
0644
defs1_solaris_amd64.go
4.014 KB
4 Dec 2025 6.06 PM
root / root
0644
defs2_linux.go
3.218 KB
4 Dec 2025 6.06 PM
root / root
0644
defs3_linux.go
1.092 KB
4 Dec 2025 6.06 PM
root / root
0644
defs_aix.go
4.175 KB
4 Dec 2025 6.06 PM
root / root
0644
defs_aix_ppc64.go
3.625 KB
4 Dec 2025 6.06 PM
root / root
0644
defs_arm_linux.go
2.67 KB
4 Dec 2025 6.06 PM
root / root
0644
defs_darwin.go
4.297 KB
4 Dec 2025 6.06 PM
root / root
0644
defs_darwin_amd64.go
6.434 KB
4 Dec 2025 6.06 PM
root / root
0644
defs_darwin_arm64.go
4.257 KB
4 Dec 2025 6.06 PM
root / root
0644
defs_dragonfly.go
2.851 KB
4 Dec 2025 6.06 PM
root / root
0644
defs_dragonfly_amd64.go
3.499 KB
4 Dec 2025 6.06 PM
root / root
0644
defs_freebsd.go
4.075 KB
4 Dec 2025 6.06 PM
root / root
0644
defs_freebsd_386.go
4.614 KB
4 Dec 2025 6.06 PM
root / root
0644
defs_freebsd_amd64.go
4.883 KB
4 Dec 2025 6.06 PM
root / root
0644
defs_freebsd_arm.go
4.005 KB
4 Dec 2025 6.06 PM
root / root
0644
defs_freebsd_arm64.go
4.269 KB
4 Dec 2025 6.06 PM
root / root
0644
defs_freebsd_riscv64.go
4.279 KB
4 Dec 2025 6.06 PM
root / root
0644
defs_illumos_amd64.go
0.278 KB
4 Dec 2025 6.06 PM
root / root
0644
defs_linux.go
2.922 KB
4 Dec 2025 6.06 PM
root / root
0644
defs_linux_386.go
4.195 KB
4 Dec 2025 6.06 PM
root / root
0644
defs_linux_amd64.go
4.703 KB
4 Dec 2025 6.06 PM
root / root
0644
defs_linux_arm.go
3.888 KB
4 Dec 2025 6.06 PM
root / root
0644
defs_linux_arm64.go
3.62 KB
4 Dec 2025 6.06 PM
root / root
0644
defs_linux_loong64.go
3.451 KB
4 Dec 2025 6.06 PM
root / root
0644
defs_linux_mips64x.go
3.601 KB
4 Dec 2025 6.06 PM
root / root
0644
defs_linux_mipsx.go
3.602 KB
4 Dec 2025 6.06 PM
root / root
0644
defs_linux_ppc64.go
3.688 KB
4 Dec 2025 6.06 PM
root / root
0644
defs_linux_ppc64le.go
3.688 KB
4 Dec 2025 6.06 PM
root / root
0644
defs_linux_riscv64.go
3.814 KB
4 Dec 2025 6.06 PM
root / root
0644
defs_linux_s390x.go
3.162 KB
4 Dec 2025 6.06 PM
root / root
0644
defs_netbsd.go
2.947 KB
4 Dec 2025 6.06 PM
root / root
0644
defs_netbsd_386.go
0.835 KB
4 Dec 2025 6.06 PM
root / root
0644
defs_netbsd_amd64.go
1.012 KB
4 Dec 2025 6.06 PM
root / root
0644
defs_netbsd_arm.go
0.746 KB
4 Dec 2025 6.06 PM
root / root
0644
defs_openbsd.go
3.058 KB
4 Dec 2025 6.06 PM
root / root
0644
defs_openbsd_386.go
2.911 KB
4 Dec 2025 6.06 PM
root / root
0644
defs_openbsd_amd64.go
3.111 KB
4 Dec 2025 6.06 PM
root / root
0644
defs_openbsd_arm.go
3.026 KB
4 Dec 2025 6.06 PM
root / root
0644
defs_openbsd_arm64.go
2.778 KB
4 Dec 2025 6.06 PM
root / root
0644
defs_openbsd_mips64.go
2.755 KB
4 Dec 2025 6.06 PM
root / root
0644
defs_openbsd_ppc64.go
3.001 KB
4 Dec 2025 6.06 PM
root / root
0644
defs_openbsd_riscv64.go
2.891 KB
4 Dec 2025 6.06 PM
root / root
0644
defs_plan9_386.go
1.627 KB
4 Dec 2025 6.06 PM
root / root
0644
defs_plan9_amd64.go
1.816 KB
4 Dec 2025 6.06 PM
root / root
0644
defs_plan9_arm.go
1.73 KB
4 Dec 2025 6.06 PM
root / root
0644
defs_solaris.go
3.319 KB
4 Dec 2025 6.06 PM
root / root
0644
defs_solaris_amd64.go
0.98 KB
4 Dec 2025 6.06 PM
root / root
0644
defs_windows.go
2.534 KB
4 Dec 2025 6.06 PM
root / root
0644
defs_windows_386.go
2.491 KB
4 Dec 2025 6.06 PM
root / root
0644
defs_windows_amd64.go
3.394 KB
4 Dec 2025 6.06 PM
root / root
0644
defs_windows_arm.go
2.956 KB
4 Dec 2025 6.06 PM
root / root
0644
defs_windows_arm64.go
3.455 KB
4 Dec 2025 6.06 PM
root / root
0644
duff_386.s
8.236 KB
4 Dec 2025 6.06 PM
root / root
0644
duff_amd64.s
5.637 KB
4 Dec 2025 6.06 PM
root / root
0644
duff_arm.s
7.111 KB
4 Dec 2025 6.06 PM
root / root
0644
duff_arm64.s
5.273 KB
4 Dec 2025 6.06 PM
root / root
0644
duff_loong64.s
11.902 KB
4 Dec 2025 6.06 PM
root / root
0644
duff_mips64x.s
11.282 KB
4 Dec 2025 6.06 PM
root / root
0644
duff_ppc64x.s
7.056 KB
4 Dec 2025 6.06 PM
root / root
0644
duff_riscv64.s
11.402 KB
4 Dec 2025 6.06 PM
root / root
0644
duff_s390x.s
0.495 KB
4 Dec 2025 6.06 PM
root / root
0644
env_plan9.go
3.019 KB
4 Dec 2025 6.06 PM
root / root
0644
env_posix.go
2.131 KB
4 Dec 2025 6.06 PM
root / root
0644
error.go
10.387 KB
4 Dec 2025 6.06 PM
root / root
0644
extern.go
19.966 KB
4 Dec 2025 6.06 PM
root / root
0644
fastlog2.go
1.22 KB
4 Dec 2025 6.06 PM
root / root
0644
fastlog2table.go
0.883 KB
4 Dec 2025 6.06 PM
root / root
0644
fds_nonunix.go
0.25 KB
4 Dec 2025 6.06 PM
root / root
0644
fds_unix.go
1.27 KB
4 Dec 2025 6.06 PM
root / root
0644
fedora.go
0.242 KB
4 Dec 2025 6.06 PM
root / root
0644
float.go
2.922 KB
4 Dec 2025 6.06 PM
root / root
0644
funcdata.h
2.526 KB
4 Dec 2025 6.06 PM
root / root
0644
go_tls.h
0.357 KB
4 Dec 2025 6.06 PM
root / root
0644
hash32.go
1.584 KB
4 Dec 2025 6.06 PM
root / root
0644
hash64.go
1.894 KB
4 Dec 2025 6.06 PM
root / root
0644
heapdump.go
17.623 KB
4 Dec 2025 6.06 PM
root / root
0644
histogram.go
7.297 KB
4 Dec 2025 6.06 PM
root / root
0644
iface.go
21.337 KB
4 Dec 2025 6.06 PM
root / root
0644
ints.s
9.863 KB
4 Dec 2025 6.06 PM
root / root
0644
lfstack.go
1.686 KB
4 Dec 2025 6.06 PM
root / root
0644
libfuzzer.go
6.342 KB
4 Dec 2025 6.06 PM
root / root
0644
libfuzzer_amd64.s
5.026 KB
4 Dec 2025 6.06 PM
root / root
0644
libfuzzer_arm64.s
3.152 KB
4 Dec 2025 6.06 PM
root / root
0644
libfuzzer_loong64.s
3.24 KB
4 Dec 2025 6.06 PM
root / root
0644
linkname.go
0.786 KB
4 Dec 2025 6.06 PM
root / root
0644
linkname_swiss.go
6.674 KB
4 Dec 2025 6.06 PM
root / root
0644
linkname_unix.go
0.26 KB
4 Dec 2025 6.06 PM
root / root
0644
lock_futex.go
3.077 KB
4 Dec 2025 6.06 PM
root / root
0644
lock_js.go
7.078 KB
4 Dec 2025 6.06 PM
root / root
0644
lock_sema.go
4.146 KB
4 Dec 2025 6.06 PM
root / root
0644
lock_spinbit.go
14.618 KB
4 Dec 2025 6.06 PM
root / root
0644
lock_wasip1.go
2.063 KB
4 Dec 2025 6.06 PM
root / root
0644
lockrank.go
24.401 KB
4 Dec 2025 6.06 PM
root / root
0644
lockrank_off.go
1.299 KB
4 Dec 2025 6.06 PM
root / root
0644
lockrank_on.go
10.562 KB
4 Dec 2025 6.06 PM
root / root
0644
malloc.go
71.77 KB
4 Dec 2025 6.06 PM
root / root
0644
map_fast32_noswiss.go
13.967 KB
4 Dec 2025 6.06 PM
root / root
0644
map_fast32_swiss.go
1.712 KB
4 Dec 2025 6.06 PM
root / root
0644
map_fast64_noswiss.go
14.181 KB
4 Dec 2025 6.06 PM
root / root
0644
map_fast64_swiss.go
1.745 KB
4 Dec 2025 6.06 PM
root / root
0644
map_faststr_noswiss.go
15.409 KB
4 Dec 2025 6.06 PM
root / root
0644
map_faststr_swiss.go
1.327 KB
4 Dec 2025 6.06 PM
root / root
0644
map_noswiss.go
57.593 KB
4 Dec 2025 6.06 PM
root / root
0644
map_swiss.go
10.174 KB
4 Dec 2025 6.06 PM
root / root
0644
mbarrier.go
15.26 KB
4 Dec 2025 6.06 PM
root / root
0644
mbitmap.go
61.238 KB
4 Dec 2025 6.06 PM
root / root
0644
mcache.go
10.449 KB
4 Dec 2025 6.06 PM
root / root
0644
mcentral.go
7.837 KB
4 Dec 2025 6.06 PM
root / root
0644
mcheckmark.go
9.268 KB
4 Dec 2025 6.06 PM
root / root
0644
mcleanup.go
23.188 KB
4 Dec 2025 6.06 PM
root / root
0644
mem.go
7.337 KB
4 Dec 2025 6.06 PM
root / root
0644
mem_aix.go
2.038 KB
4 Dec 2025 6.06 PM
root / root
0644
mem_bsd.go
2.244 KB
4 Dec 2025 6.06 PM
root / root
0644
mem_darwin.go
1.987 KB
4 Dec 2025 6.06 PM
root / root
0644
mem_js.go
0.446 KB
4 Dec 2025 6.06 PM
root / root
0644
mem_linux.go
5.222 KB
4 Dec 2025 6.06 PM
root / root
0644
mem_nonsbrk.go
0.344 KB
4 Dec 2025 6.06 PM
root / root
0644
mem_plan9.go
0.437 KB
4 Dec 2025 6.06 PM
root / root
0644
mem_sbrk.go
6.113 KB
4 Dec 2025 6.06 PM
root / root
0644
mem_wasip1.go
0.383 KB
4 Dec 2025 6.06 PM
root / root
0644
mem_wasm.go
0.57 KB
4 Dec 2025 6.06 PM
root / root
0644
mem_windows.go
3.905 KB
4 Dec 2025 6.06 PM
root / root
0644
memclr_386.s
2.381 KB
4 Dec 2025 6.06 PM
root / root
0644
memclr_amd64.s
4.906 KB
4 Dec 2025 6.06 PM
root / root
0644
memclr_arm.s
2.604 KB
4 Dec 2025 6.06 PM
root / root
0644
memclr_arm64.s
3.684 KB
4 Dec 2025 6.06 PM
root / root
0644
memclr_loong64.s
6.951 KB
4 Dec 2025 6.06 PM
root / root
0644
memclr_mips64x.s
1.722 KB
4 Dec 2025 6.06 PM
root / root
0644
memclr_mipsx.s
1.324 KB
4 Dec 2025 6.06 PM
root / root
0644
memclr_plan9_386.s
0.96 KB
4 Dec 2025 6.06 PM
root / root
0644
memclr_plan9_amd64.s
0.499 KB
4 Dec 2025 6.06 PM
root / root
0644
memclr_ppc64x.s
4.438 KB
4 Dec 2025 6.06 PM
root / root
0644
memclr_riscv64.s
1.705 KB
4 Dec 2025 6.06 PM
root / root
0644
memclr_s390x.s
3.558 KB
4 Dec 2025 6.06 PM
root / root
0644
memclr_wasm.s
0.474 KB
4 Dec 2025 6.06 PM
root / root
0644
memmove_386.s
4.419 KB
4 Dec 2025 6.06 PM
root / root
0644
memmove_amd64.s
12.874 KB
4 Dec 2025 6.06 PM
root / root
0644
memmove_arm.s
5.897 KB
4 Dec 2025 6.06 PM
root / root
0644
memmove_arm64.s
5.955 KB
4 Dec 2025 6.06 PM
root / root
0644
memmove_loong64.s
11.653 KB
4 Dec 2025 6.06 PM
root / root
0644
memmove_mips64x.s
1.826 KB
4 Dec 2025 6.06 PM
root / root
0644
memmove_mipsx.s
4.396 KB
4 Dec 2025 6.06 PM
root / root
0644
memmove_plan9_386.s
3.063 KB
4 Dec 2025 6.06 PM
root / root
0644
memmove_plan9_amd64.s
3.041 KB
4 Dec 2025 6.06 PM
root / root
0644
memmove_ppc64x.s
4.858 KB
4 Dec 2025 6.06 PM
root / root
0644
memmove_riscv64.s
5.461 KB
4 Dec 2025 6.06 PM
root / root
0644
memmove_s390x.s
2.918 KB
4 Dec 2025 6.06 PM
root / root
0644
memmove_wasm.s
0.468 KB
4 Dec 2025 6.06 PM
root / root
0644
metrics.go
25.988 KB
4 Dec 2025 6.06 PM
root / root
0644
mfinal.go
19.779 KB
4 Dec 2025 6.06 PM
root / root
0644
mfixalloc.go
3.127 KB
4 Dec 2025 6.06 PM
root / root
0644
mgc.go
64.943 KB
4 Dec 2025 6.06 PM
root / root
0644
mgclimit.go
17.241 KB
4 Dec 2025 6.06 PM
root / root
0644
mgcmark.go
55.107 KB
4 Dec 2025 6.06 PM
root / root
0644
mgcmark_greenteagc.go
27.73 KB
4 Dec 2025 6.06 PM
root / root
0644
mgcmark_nogreenteagc.go
2.204 KB
4 Dec 2025 6.06 PM
root / root
0644
mgcpacer.go
56.521 KB
4 Dec 2025 6.06 PM
root / root
0644
mgcscavenge.go
52.258 KB
4 Dec 2025 6.06 PM
root / root
0644
mgcstack.go
10.585 KB
4 Dec 2025 6.06 PM
root / root
0644
mgcsweep.go
32.938 KB
4 Dec 2025 6.06 PM
root / root
0644
mgcwork.go
14.936 KB
4 Dec 2025 6.06 PM
root / root
0644
mheap.go
97.843 KB
4 Dec 2025 6.06 PM
root / root
0644
minmax.go
1.458 KB
4 Dec 2025 6.06 PM
root / root
0644
mkduff.go
8.029 KB
4 Dec 2025 6.06 PM
root / root
0644
mkfastlog2table.go
3.075 KB
4 Dec 2025 6.06 PM
root / root
0644
mklockrank.go
9.474 KB
4 Dec 2025 6.06 PM
root / root
0644
mkpreempt.go
14.839 KB
4 Dec 2025 6.06 PM
root / root
0644
mmap.go
0.824 KB
4 Dec 2025 6.06 PM
root / root
0644
mpagealloc.go
39.259 KB
4 Dec 2025 6.06 PM
root / root
0644
mpagealloc_32bit.go
4.609 KB
4 Dec 2025 6.06 PM
root / root
0644
mpagealloc_64bit.go
9.406 KB
4 Dec 2025 6.06 PM
root / root
0644
mpagecache.go
5.593 KB
4 Dec 2025 6.06 PM
root / root
0644
mpallocbits.go
12.526 KB
4 Dec 2025 6.06 PM
root / root
0644
mprof.go
54.017 KB
4 Dec 2025 6.06 PM
root / root
0644
mranges.go
14.455 KB
4 Dec 2025 6.06 PM
root / root
0644
msan.go
1.622 KB
4 Dec 2025 6.06 PM
root / root
0644
msan0.go
0.708 KB
4 Dec 2025 6.06 PM
root / root
0644
msan_amd64.s
2.415 KB
4 Dec 2025 6.06 PM
root / root
0644
msan_arm64.s
2.091 KB
4 Dec 2025 6.06 PM
root / root
0644
msan_loong64.s
2.066 KB
4 Dec 2025 6.06 PM
root / root
0644
msize.go
1.351 KB
4 Dec 2025 6.06 PM
root / root
0644
mspanset.go
13.307 KB
4 Dec 2025 6.06 PM
root / root
0644
mstats.go
33.924 KB
4 Dec 2025 6.06 PM
root / root
0644
mwbbuf.go
8.184 KB
4 Dec 2025 6.06 PM
root / root
0644
nbpipe_pipe.go
0.396 KB
4 Dec 2025 6.06 PM
root / root
0644
nbpipe_pipe2.go
0.336 KB
4 Dec 2025 6.06 PM
root / root
0644
net_plan9.go
0.63 KB
4 Dec 2025 6.06 PM
root / root
0644
netpoll.go
20.81 KB
4 Dec 2025 6.06 PM
root / root
0644
netpoll_aix.go
5.166 KB
4 Dec 2025 6.06 PM
root / root
0644
netpoll_epoll.go
4.697 KB
4 Dec 2025 6.06 PM
root / root
0644
netpoll_fake.go
0.648 KB
4 Dec 2025 6.06 PM
root / root
0644
netpoll_kqueue.go
4.691 KB
4 Dec 2025 6.06 PM
root / root
0644
netpoll_kqueue_event.go
1.778 KB
4 Dec 2025 6.06 PM
root / root
0644
netpoll_kqueue_pipe.go
2.143 KB
4 Dec 2025 6.06 PM
root / root
0644
netpoll_solaris.go
11.311 KB
4 Dec 2025 6.06 PM
root / root
0644
netpoll_stub.go
1.579 KB
4 Dec 2025 6.06 PM
root / root
0644
netpoll_wasip1.go
6.004 KB
4 Dec 2025 6.06 PM
root / root
0644
netpoll_windows.go
9.491 KB
4 Dec 2025 6.06 PM
root / root
0644
nonwindows_stub.go
0.939 KB
4 Dec 2025 6.06 PM
root / root
0644
note_js.go
1.343 KB
4 Dec 2025 6.06 PM
root / root
0644
note_other.go
1.191 KB
4 Dec 2025 6.06 PM
root / root
0644
os2_aix.go
20.961 KB
4 Dec 2025 6.06 PM
root / root
0644
os2_freebsd.go
0.295 KB
4 Dec 2025 6.06 PM
root / root
0644
os2_openbsd.go
0.289 KB
4 Dec 2025 6.06 PM
root / root
0644
os2_plan9.go
1.481 KB
4 Dec 2025 6.06 PM
root / root
0644
os2_solaris.go
0.313 KB
4 Dec 2025 6.06 PM
root / root
0644
os3_plan9.go
3.977 KB
4 Dec 2025 6.06 PM
root / root
0644
os3_solaris.go
17.703 KB
4 Dec 2025 6.06 PM
root / root
0644
os_aix.go
9.052 KB
4 Dec 2025 6.06 PM
root / root
0644
os_android.go
0.452 KB
4 Dec 2025 6.06 PM
root / root
0644
os_darwin.go
11.864 KB
4 Dec 2025 6.06 PM
root / root
0644
os_darwin_arm64.go
0.321 KB
4 Dec 2025 6.06 PM
root / root
0644
os_dragonfly.go
7.312 KB
4 Dec 2025 6.06 PM
root / root
0644
os_freebsd.go
11.729 KB
4 Dec 2025 6.06 PM
root / root
0644
os_freebsd2.go
0.589 KB
4 Dec 2025 6.06 PM
root / root
0644
os_freebsd_amd64.go
0.643 KB
4 Dec 2025 6.06 PM
root / root
0644
os_freebsd_arm.go
1.466 KB
4 Dec 2025 6.06 PM
root / root
0644
os_freebsd_arm64.go
0.313 KB
4 Dec 2025 6.06 PM
root / root
0644
os_freebsd_noauxv.go
0.235 KB
4 Dec 2025 6.06 PM
root / root
0644
os_freebsd_riscv64.go
0.193 KB
4 Dec 2025 6.06 PM
root / root
0644
os_illumos.go
3.931 KB
4 Dec 2025 6.06 PM
root / root
0644
os_js.go
0.749 KB
4 Dec 2025 6.06 PM
root / root
0644
os_linux.go
27.048 KB
4 Dec 2025 6.06 PM
root / root
0644
os_linux_arm.go
1.506 KB
4 Dec 2025 6.06 PM
root / root
0644
os_linux_arm64.go
0.467 KB
4 Dec 2025 6.06 PM
root / root
0644
os_linux_be64.go
0.787 KB
4 Dec 2025 6.06 PM
root / root
0644
os_linux_generic.go
0.85 KB
4 Dec 2025 6.06 PM
root / root
0644
os_linux_loong64.go
0.337 KB
4 Dec 2025 6.06 PM
root / root
0644
os_linux_mips64x.go
0.973 KB
4 Dec 2025 6.06 PM
root / root
0644
os_linux_mipsx.go
0.964 KB
4 Dec 2025 6.06 PM
root / root
0644
os_linux_noauxv.go
0.329 KB
4 Dec 2025 6.06 PM
root / root
0644
os_linux_novdso.go
0.339 KB
4 Dec 2025 6.06 PM
root / root
0644
os_linux_ppc64x.go
0.514 KB
4 Dec 2025 6.06 PM
root / root
0644
os_linux_riscv64.go
1.362 KB
4 Dec 2025 6.06 PM
root / root
0644
os_linux_s390x.go
0.806 KB
4 Dec 2025 6.06 PM
root / root
0644
os_linux_x86.go
0.229 KB
4 Dec 2025 6.06 PM
root / root
0644
os_netbsd.go
10.232 KB
4 Dec 2025 6.06 PM
root / root
0644
os_netbsd_386.go
0.603 KB
4 Dec 2025 6.06 PM
root / root
0644
os_netbsd_amd64.go
0.6 KB
4 Dec 2025 6.06 PM
root / root
0644
os_netbsd_arm.go
1.094 KB
4 Dec 2025 6.06 PM
root / root
0644
os_netbsd_arm64.go
0.751 KB
4 Dec 2025 6.06 PM
root / root
0644
os_nonopenbsd.go
0.427 KB
4 Dec 2025 6.06 PM
root / root
0644
os_only_solaris.go
0.353 KB
4 Dec 2025 6.06 PM
root / root
0644
os_openbsd.go
6.447 KB
4 Dec 2025 6.06 PM
root / root
0644
os_openbsd_arm.go
0.667 KB
4 Dec 2025 6.06 PM
root / root
0644
os_openbsd_arm64.go
0.321 KB
4 Dec 2025 6.06 PM
root / root
0644
os_openbsd_libc.go
1.488 KB
4 Dec 2025 6.06 PM
root / root
0644
os_openbsd_mips64.go
0.321 KB
4 Dec 2025 6.06 PM
root / root
0644
os_openbsd_syscall.go
1.359 KB
4 Dec 2025 6.06 PM
root / root
0644
os_openbsd_syscall1.go
0.431 KB
4 Dec 2025 6.06 PM
root / root
0644
os_openbsd_syscall2.go
2.511 KB
4 Dec 2025 6.06 PM
root / root
0644
os_plan9.go
11.943 KB
4 Dec 2025 6.06 PM
root / root
0644
os_plan9_arm.go
0.366 KB
4 Dec 2025 6.06 PM
root / root
0644
os_solaris.go
6.707 KB
4 Dec 2025 6.06 PM
root / root
0644
os_unix.go
0.426 KB
4 Dec 2025 6.06 PM
root / root
0644
os_unix_nonlinux.go
0.505 KB
4 Dec 2025 6.06 PM
root / root
0644
os_wasip1.go
6.88 KB
4 Dec 2025 6.06 PM
root / root
0644
os_wasm.go
3.314 KB
4 Dec 2025 6.06 PM
root / root
0644
os_windows.go
40.658 KB
4 Dec 2025 6.06 PM
root / root
0644
os_windows_arm.go
0.499 KB
4 Dec 2025 6.06 PM
root / root
0644
os_windows_arm64.go
0.331 KB
4 Dec 2025 6.06 PM
root / root
0644
panic.go
45.134 KB
4 Dec 2025 6.06 PM
root / root
0644
panic32.go
4.895 KB
4 Dec 2025 6.06 PM
root / root
0644
pinner.go
10.994 KB
4 Dec 2025 6.06 PM
root / root
0644
plugin.go
4.394 KB
4 Dec 2025 6.06 PM
root / root
0644
preempt.go
15.458 KB
4 Dec 2025 6.06 PM
root / root
0644
preempt_386.s
0.805 KB
4 Dec 2025 6.06 PM
root / root
0644
preempt_amd64.s
1.541 KB
4 Dec 2025 6.06 PM
root / root
0644
preempt_arm.s
1.487 KB
4 Dec 2025 6.06 PM
root / root
0644
preempt_arm64.s
1.967 KB
4 Dec 2025 6.06 PM
root / root
0644
preempt_loong64.s
2.411 KB
4 Dec 2025 6.06 PM
root / root
0644
preempt_mips64x.s
2.716 KB
4 Dec 2025 6.06 PM
root / root
0644
preempt_mipsx.s
2.681 KB
4 Dec 2025 6.06 PM
root / root
0644
preempt_nonwindows.go
0.283 KB
4 Dec 2025 6.06 PM
root / root
0644
preempt_ppc64x.s
2.716 KB
4 Dec 2025 6.06 PM
root / root
0644
preempt_riscv64.s
2.258 KB
4 Dec 2025 6.06 PM
root / root
0644
preempt_s390x.s
1.009 KB
4 Dec 2025 6.06 PM
root / root
0644
preempt_wasm.s
0.172 KB
4 Dec 2025 6.06 PM
root / root
0644
print.go
5.921 KB
4 Dec 2025 6.06 PM
root / root
0644
proc.go
220.345 KB
4 Dec 2025 6.06 PM
root / root
0644
profbuf.go
18.203 KB
4 Dec 2025 6.06 PM
root / root
0644
proflabel.go
2.059 KB
4 Dec 2025 6.06 PM
root / root
0644
race.go
22.501 KB
4 Dec 2025 6.06 PM
root / root
0644
race0.go
2.894 KB
4 Dec 2025 6.06 PM
root / root
0644
race_amd64.s
15.17 KB
4 Dec 2025 6.06 PM
root / root
0644
race_arm64.s
15.554 KB
4 Dec 2025 6.06 PM
root / root
0644
race_loong64.s
15.241 KB
4 Dec 2025 6.06 PM
root / root
0644
race_ppc64le.s
17.035 KB
4 Dec 2025 6.06 PM
root / root
0644
race_s390x.s
13.131 KB
4 Dec 2025 6.06 PM
root / root
0644
rand.go
8.788 KB
4 Dec 2025 6.06 PM
root / root
0644
rdebug.go
0.537 KB
4 Dec 2025 6.06 PM
root / root
0644
retry.go
0.742 KB
4 Dec 2025 6.06 PM
root / root
0644
rt0_aix_ppc64.s
5.056 KB
4 Dec 2025 6.06 PM
root / root
0644
rt0_android_386.s
0.803 KB
4 Dec 2025 6.06 PM
root / root
0644
rt0_android_amd64.s
0.736 KB
4 Dec 2025 6.06 PM
root / root
0644
rt0_android_arm.s
0.823 KB
4 Dec 2025 6.06 PM
root / root
0644
rt0_android_arm64.s
0.919 KB
4 Dec 2025 6.06 PM
root / root
0644
rt0_darwin_amd64.s
0.39 KB
4 Dec 2025 6.06 PM
root / root
0644
rt0_darwin_arm64.s
1.688 KB
4 Dec 2025 6.06 PM
root / root
0644
rt0_dragonfly_amd64.s
0.438 KB
4 Dec 2025 6.06 PM
root / root
0644
rt0_freebsd_386.s
0.443 KB
4 Dec 2025 6.06 PM
root / root
0644
rt0_freebsd_amd64.s
0.432 KB
4 Dec 2025 6.06 PM
root / root
0644
rt0_freebsd_arm.s
0.291 KB
4 Dec 2025 6.06 PM
root / root
0644
rt0_freebsd_arm64.s
1.879 KB
4 Dec 2025 6.06 PM
root / root
0644
rt0_freebsd_riscv64.s
2.721 KB
4 Dec 2025 6.06 PM
root / root
0644
rt0_illumos_amd64.s
0.304 KB
4 Dec 2025 6.06 PM
root / root
0644
rt0_ios_amd64.s
0.415 KB
4 Dec 2025 6.06 PM
root / root
0644
rt0_ios_arm64.s
0.415 KB
4 Dec 2025 6.06 PM
root / root
0644
rt0_js_wasm.s
1.431 KB
4 Dec 2025 6.06 PM
root / root
0644
rt0_linux_386.s
0.439 KB
4 Dec 2025 6.06 PM
root / root
0644
rt0_linux_amd64.s
0.3 KB
4 Dec 2025 6.06 PM
root / root
0644
rt0_linux_arm.s
0.983 KB
4 Dec 2025 6.06 PM
root / root
0644
rt0_linux_arm64.s
1.809 KB
4 Dec 2025 6.06 PM
root / root
0644
rt0_linux_loong64.s
2.009 KB
4 Dec 2025 6.06 PM
root / root
0644
rt0_linux_mips64x.s
0.99 KB
4 Dec 2025 6.06 PM
root / root
0644
rt0_linux_mipsx.s
0.778 KB
4 Dec 2025 6.06 PM
root / root
0644
rt0_linux_ppc64.s
0.827 KB
4 Dec 2025 6.06 PM
root / root
0644
rt0_linux_ppc64le.s
2.887 KB
4 Dec 2025 6.06 PM
root / root
0644
rt0_linux_riscv64.s
2.648 KB
4 Dec 2025 6.06 PM
root / root
0644
rt0_linux_s390x.s
0.66 KB
4 Dec 2025 6.06 PM
root / root
0644
rt0_netbsd_386.s
0.441 KB
4 Dec 2025 6.06 PM
root / root
0644
rt0_netbsd_amd64.s
0.302 KB
4 Dec 2025 6.06 PM
root / root
0644
rt0_netbsd_arm.s
0.289 KB
4 Dec 2025 6.06 PM
root / root
0644
rt0_netbsd_arm64.s
1.803 KB
4 Dec 2025 6.06 PM
root / root
0644
rt0_openbsd_386.s
0.443 KB
4 Dec 2025 6.06 PM
root / root
0644
rt0_openbsd_amd64.s
0.304 KB
4 Dec 2025 6.06 PM
root / root
0644
rt0_openbsd_arm.s
0.291 KB
4 Dec 2025 6.06 PM
root / root
0644
rt0_openbsd_arm64.s
1.961 KB
4 Dec 2025 6.06 PM
root / root
0644
rt0_openbsd_mips64.s
0.953 KB
4 Dec 2025 6.06 PM
root / root
0644
rt0_openbsd_ppc64.s
0.361 KB
4 Dec 2025 6.06 PM
root / root
0644
rt0_openbsd_riscv64.s
0.363 KB
4 Dec 2025 6.06 PM
root / root
0644
rt0_plan9_386.s
0.511 KB
4 Dec 2025 6.06 PM
root / root
0644
rt0_plan9_amd64.s
0.47 KB
4 Dec 2025 6.06 PM
root / root
0644
rt0_plan9_arm.s
0.388 KB
4 Dec 2025 6.06 PM
root / root
0644
rt0_solaris_amd64.s
0.304 KB
4 Dec 2025 6.06 PM
root / root
0644
rt0_wasip1_wasm.s
0.453 KB
4 Dec 2025 6.06 PM
root / root
0644
rt0_windows_386.s
1.28 KB
4 Dec 2025 6.06 PM
root / root
0644
rt0_windows_amd64.s
1.139 KB
4 Dec 2025 6.06 PM
root / root
0644
rt0_windows_arm.s
0.377 KB
4 Dec 2025 6.06 PM
root / root
0644
rt0_windows_arm64.s
0.716 KB
4 Dec 2025 6.06 PM
root / root
0644
runtime-gdb.py
18.864 KB
4 Dec 2025 6.06 PM
root / root
0644
runtime.go
9.768 KB
4 Dec 2025 6.06 PM
root / root
0644
runtime1.go
20.791 KB
4 Dec 2025 6.06 PM
root / root
0644
runtime2.go
50.123 KB
4 Dec 2025 6.06 PM
root / root
0644
runtime_boring.go
0.447 KB
4 Dec 2025 6.06 PM
root / root
0644
rwmutex.go
4.984 KB
4 Dec 2025 6.06 PM
root / root
0644
security_aix.go
0.438 KB
4 Dec 2025 6.06 PM
root / root
0644
security_issetugid.go
0.49 KB
4 Dec 2025 6.06 PM
root / root
0644
security_linux.go
0.327 KB
4 Dec 2025 6.06 PM
root / root
0644
security_nonunix.go
0.25 KB
4 Dec 2025 6.06 PM
root / root
0644
security_unix.go
0.846 KB
4 Dec 2025 6.06 PM
root / root
0644
select.go
15.398 KB
4 Dec 2025 6.06 PM
root / root
0644
sema.go
20.174 KB
4 Dec 2025 6.06 PM
root / root
0644
set_vma_name_linux.go
0.936 KB
4 Dec 2025 6.06 PM
root / root
0644
set_vma_name_stub.go
0.355 KB
4 Dec 2025 6.06 PM
root / root
0644
sigaction.go
0.489 KB
4 Dec 2025 6.06 PM
root / root
0644
signal_386.go
1.718 KB
4 Dec 2025 6.06 PM
root / root
0644
signal_aix_ppc64.go
3.545 KB
4 Dec 2025 6.06 PM
root / root
0644
signal_amd64.go
2.726 KB
4 Dec 2025 6.06 PM
root / root
0644
signal_arm.go
2.543 KB
4 Dec 2025 6.06 PM
root / root
0644
signal_arm64.go
3.828 KB
4 Dec 2025 6.06 PM
root / root
0644
signal_darwin.go
2.128 KB
4 Dec 2025 6.06 PM
root / root
0644
signal_darwin_amd64.go
4.004 KB
4 Dec 2025 6.06 PM
root / root
0644
signal_darwin_arm64.go
3.598 KB
4 Dec 2025 6.06 PM
root / root
0644
signal_dragonfly.go
2.171 KB
4 Dec 2025 6.06 PM
root / root
0644
signal_dragonfly_amd64.go
2.015 KB
4 Dec 2025 6.06 PM
root / root
0644
signal_freebsd.go
2.202 KB
4 Dec 2025 6.06 PM
root / root
0644
signal_freebsd_386.go
1.551 KB
4 Dec 2025 6.06 PM
root / root
0644
signal_freebsd_amd64.go
2.03 KB
4 Dec 2025 6.06 PM
root / root
0644
signal_freebsd_arm.go
2.179 KB
4 Dec 2025 6.06 PM
root / root
0644
signal_freebsd_arm64.go
3.237 KB
4 Dec 2025 6.06 PM
root / root
0644
signal_freebsd_riscv64.go
3.075 KB
4 Dec 2025 6.06 PM
root / root
0644
signal_linux_386.go
1.592 KB
4 Dec 2025 6.06 PM
root / root
0644
signal_linux_amd64.go
2.051 KB
4 Dec 2025 6.06 PM
root / root
0644
signal_linux_arm.go
2.123 KB
4 Dec 2025 6.06 PM
root / root
0644
signal_linux_arm64.go
2.945 KB
4 Dec 2025 6.06 PM
root / root
0644
signal_linux_loong64.go
3.216 KB
4 Dec 2025 6.06 PM
root / root
0644
signal_linux_mips64x.go
3.35 KB
4 Dec 2025 6.06 PM
root / root
0644
signal_linux_mipsx.go
3.667 KB
4 Dec 2025 6.06 PM
root / root
0644
signal_linux_ppc64x.go
3.501 KB
4 Dec 2025 6.06 PM
root / root
0644
signal_linux_riscv64.go
2.921 KB
4 Dec 2025 6.06 PM
root / root
0644
signal_linux_s390x.go
4.485 KB
4 Dec 2025 6.06 PM
root / root
0644
signal_loong64.go
3.072 KB
4 Dec 2025 6.06 PM
root / root
0644
signal_mips64x.go
3.181 KB
4 Dec 2025 6.06 PM
root / root
0644
signal_mipsx.go
3.06 KB
4 Dec 2025 6.06 PM
root / root
0644
signal_netbsd.go
2.181 KB
4 Dec 2025 6.06 PM
root / root
0644
signal_netbsd_386.go
1.757 KB
4 Dec 2025 6.06 PM
root / root
0644
signal_netbsd_amd64.go
2.325 KB
4 Dec 2025 6.06 PM
root / root
0644
signal_netbsd_arm.go
2.301 KB
4 Dec 2025 6.06 PM
root / root
0644
signal_netbsd_arm64.go
3.404 KB
4 Dec 2025 6.06 PM
root / root
0644
signal_openbsd.go
2.18 KB
4 Dec 2025 6.06 PM
root / root
0644
signal_openbsd_386.go
1.585 KB
4 Dec 2025 6.06 PM
root / root
0644
signal_openbsd_amd64.go
2.036 KB
4 Dec 2025 6.06 PM
root / root
0644
signal_openbsd_arm.go
2.117 KB
4 Dec 2025 6.06 PM
root / root
0644
signal_openbsd_arm64.go
3.391 KB
4 Dec 2025 6.06 PM
root / root
0644
signal_openbsd_mips64.go
3.282 KB
4 Dec 2025 6.06 PM
root / root
0644
signal_openbsd_ppc64.go
3.53 KB
4 Dec 2025 6.06 PM
root / root
0644
signal_openbsd_riscv64.go
3.12 KB
4 Dec 2025 6.06 PM
root / root
0644
signal_plan9.go
1.934 KB
4 Dec 2025 6.06 PM
root / root
0644
signal_ppc64x.go
3.708 KB
4 Dec 2025 6.06 PM
root / root
0644
signal_riscv64.go
2.91 KB
4 Dec 2025 6.06 PM
root / root
0644
signal_solaris.go
4.501 KB
4 Dec 2025 6.06 PM
root / root
0644
signal_solaris_amd64.go
2.466 KB
4 Dec 2025 6.06 PM
root / root
0644
signal_unix.go
45.658 KB
4 Dec 2025 6.06 PM
root / root
0644
signal_windows.go
14.353 KB
4 Dec 2025 6.06 PM
root / root
0644
sigqueue.go
7.618 KB
4 Dec 2025 6.06 PM
root / root
0644
sigqueue_note.go
0.633 KB
4 Dec 2025 6.06 PM
root / root
0644
sigqueue_plan9.go
3.254 KB
4 Dec 2025 6.06 PM
root / root
0644
sigtab_aix.go
11.304 KB
4 Dec 2025 6.06 PM
root / root
0644
sigtab_linux_generic.go
3.518 KB
4 Dec 2025 6.06 PM
root / root
0644
sigtab_linux_mipsx.go
5.953 KB
4 Dec 2025 6.06 PM
root / root
0644
slice.go
12.204 KB
4 Dec 2025 6.06 PM
root / root
0644
softfloat64.go
11.536 KB
4 Dec 2025 6.06 PM
root / root
0644
stack.go
42.74 KB
4 Dec 2025 6.06 PM
root / root
0644
stkframe.go
9.771 KB
4 Dec 2025 6.06 PM
root / root
0644
string.go
13.166 KB
4 Dec 2025 6.06 PM
root / root
0644
stubs.go
18.087 KB
4 Dec 2025 6.06 PM
root / root
0644
stubs2.go
1.146 KB
4 Dec 2025 6.06 PM
root / root
0644
stubs3.go
0.316 KB
4 Dec 2025 6.06 PM
root / root
0644
stubs_386.go
0.691 KB
4 Dec 2025 6.06 PM
root / root
0644
stubs_amd64.go
1.384 KB
4 Dec 2025 6.06 PM
root / root
0644
stubs_arm.go
0.673 KB
4 Dec 2025 6.06 PM
root / root
0644
stubs_arm64.go
0.684 KB
4 Dec 2025 6.06 PM
root / root
0644
stubs_linux.go
0.635 KB
4 Dec 2025 6.06 PM
root / root
0644
stubs_loong64.go
0.623 KB
4 Dec 2025 6.06 PM
root / root
0644
stubs_mips64x.go
0.51 KB
4 Dec 2025 6.06 PM
root / root
0644
stubs_mipsx.go
0.431 KB
4 Dec 2025 6.06 PM
root / root
0644
stubs_nonlinux.go
0.291 KB
4 Dec 2025 6.06 PM
root / root
0644
stubs_nonwasm.go
0.271 KB
4 Dec 2025 6.06 PM
root / root
0644
stubs_ppc64.go
0.295 KB
4 Dec 2025 6.06 PM
root / root
0644
stubs_ppc64x.go
0.672 KB
4 Dec 2025 6.06 PM
root / root
0644
stubs_riscv64.go
0.679 KB
4 Dec 2025 6.06 PM
root / root
0644
stubs_s390x.go
0.404 KB
4 Dec 2025 6.06 PM
root / root
0644
stubs_wasm.go
0.691 KB
4 Dec 2025 6.06 PM
root / root
0644
symtab.go
40.96 KB
4 Dec 2025 6.06 PM
root / root
0644
symtabinl.go
4.526 KB
4 Dec 2025 6.06 PM
root / root
0644
synctest.go
12.779 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_aix_ppc64.s
7.42 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_arm.go
0.509 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_arm64.go
0.458 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_darwin.go
24.438 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_darwin_amd64.s
19.855 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_darwin_arm64.go
1.738 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_darwin_arm64.s
18.422 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_dragonfly_amd64.s
8.31 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_freebsd_386.s
9.409 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_freebsd_amd64.s
12.675 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_freebsd_arm.s
10.378 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_freebsd_arm64.s
9.493 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_freebsd_riscv64.s
8.918 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_libc.go
1.878 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_linux_386.s
17.89 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_linux_amd64.s
16.357 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_linux_arm.s
13.502 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_linux_arm64.s
17.529 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_linux_loong64.s
16.812 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_linux_mips64x.s
11.965 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_linux_mipsx.s
9.69 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_linux_ppc64x.s
18.909 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_linux_riscv64.s
10.523 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_linux_s390x.s
13.451 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_loong64.go
0.478 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_mips64x.go
0.488 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_mipsx.go
0.484 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_netbsd_386.s
9.608 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_netbsd_amd64.s
9.782 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_netbsd_arm.s
10.576 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_netbsd_arm64.s
9.469 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_nonppc64x.go
0.239 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_openbsd.go
2.593 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_openbsd1.go
1.229 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_openbsd2.go
8.671 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_openbsd3.go
4.069 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_openbsd_386.s
20.4 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_openbsd_amd64.s
15.539 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_openbsd_arm.s
18.461 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_openbsd_arm64.s
15.053 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_openbsd_mips64.s
8.807 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_openbsd_ppc64.s
15.297 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_openbsd_riscv64.s
16.802 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_plan9_386.s
4.335 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_plan9_amd64.s
4.732 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_plan9_arm.s
6.798 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_ppc64x.go
0.52 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_riscv64.go
0.458 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_s390x.go
0.458 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_solaris_amd64.s
6.418 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_wasm.go
1.127 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_wasm.s
1.521 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_windows_386.s
6.457 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_windows_amd64.s
8.418 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_windows_arm.s
7.744 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_windows_arm64.s
6.797 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_x86.go
0.539 KB
4 Dec 2025 6.06 PM
root / root
0644
syscall2_solaris.go
1.85 KB
4 Dec 2025 6.06 PM
root / root
0644
syscall_aix.go
6.332 KB
4 Dec 2025 6.06 PM
root / root
0644
syscall_solaris.go
8.383 KB
4 Dec 2025 6.06 PM
root / root
0644
syscall_windows.go
16.67 KB
4 Dec 2025 6.06 PM
root / root
0644
tagptr.go
0.891 KB
4 Dec 2025 6.06 PM
root / root
0644
tagptr_32bit.go
0.964 KB
4 Dec 2025 6.06 PM
root / root
0644
tagptr_64bit.go
3.127 KB
4 Dec 2025 6.06 PM
root / root
0644
test_amd64.go
0.191 KB
4 Dec 2025 6.06 PM
root / root
0644
test_amd64.s
0.309 KB
4 Dec 2025 6.06 PM
root / root
0644
test_stubs.go
0.213 KB
4 Dec 2025 6.06 PM
root / root
0644
textflag.h
1.466 KB
4 Dec 2025 6.06 PM
root / root
0644
time.go
43.854 KB
4 Dec 2025 6.06 PM
root / root
0644
time_fake.go
2.521 KB
4 Dec 2025 6.06 PM
root / root
0644
time_linux_amd64.s
2.019 KB
4 Dec 2025 6.06 PM
root / root
0644
time_nofake.go
1.568 KB
4 Dec 2025 6.06 PM
root / root
0644
time_plan9.go
0.629 KB
4 Dec 2025 6.06 PM
root / root
0644
time_windows.h
0.735 KB
4 Dec 2025 6.06 PM
root / root
0644
time_windows_386.s
1.707 KB
4 Dec 2025 6.06 PM
root / root
0644
time_windows_amd64.s
0.768 KB
4 Dec 2025 6.06 PM
root / root
0644
time_windows_arm.s
1.974 KB
4 Dec 2025 6.06 PM
root / root
0644
time_windows_arm64.s
0.885 KB
4 Dec 2025 6.06 PM
root / root
0644
timeasm.go
0.408 KB
4 Dec 2025 6.06 PM
root / root
0644
timestub.go
0.878 KB
4 Dec 2025 6.06 PM
root / root
0644
timestub2.go
0.364 KB
4 Dec 2025 6.06 PM
root / root
0644
tls_arm.s
3.451 KB
4 Dec 2025 6.06 PM
root / root
0644
tls_arm64.h
1.098 KB
4 Dec 2025 6.06 PM
root / root
0644
tls_arm64.s
1.199 KB
4 Dec 2025 6.06 PM
root / root
0644
tls_loong64.s
0.575 KB
4 Dec 2025 6.06 PM
root / root
0644
tls_mips64x.s
0.716 KB
4 Dec 2025 6.06 PM
root / root
0644
tls_mipsx.s
0.693 KB
4 Dec 2025 6.06 PM
root / root
0644
tls_ppc64x.s
1.523 KB
4 Dec 2025 6.06 PM
root / root
0644
tls_riscv64.s
0.601 KB
4 Dec 2025 6.06 PM
root / root
0644
tls_s390x.s
1.546 KB
4 Dec 2025 6.06 PM
root / root
0644
tls_stub.go
0.254 KB
4 Dec 2025 6.06 PM
root / root
0644
tls_windows_amd64.go
0.287 KB
4 Dec 2025 6.06 PM
root / root
0644
trace.go
38.343 KB
4 Dec 2025 6.06 PM
root / root
0644
traceallocfree.go
5.998 KB
4 Dec 2025 6.06 PM
root / root
0644
traceback.go
56.618 KB
4 Dec 2025 6.06 PM
root / root
0644
tracebuf.go
10.405 KB
4 Dec 2025 6.06 PM
root / root
0644
tracecpu.go
8.79 KB
4 Dec 2025 6.06 PM
root / root
0644
traceevent.go
3.685 KB
4 Dec 2025 6.06 PM
root / root
0644
tracemap.go
4.529 KB
4 Dec 2025 6.06 PM
root / root
0644
traceregion.go
3.402 KB
4 Dec 2025 6.06 PM
root / root
0644
traceruntime.go
25.478 KB
4 Dec 2025 6.06 PM
root / root
0644
tracestack.go
11.361 KB
4 Dec 2025 6.06 PM
root / root
0644
tracestatus.go
6.927 KB
4 Dec 2025 6.06 PM
root / root
0644
tracestring.go
2.438 KB
4 Dec 2025 6.06 PM
root / root
0644
tracetime.go
3.829 KB
4 Dec 2025 6.06 PM
root / root
0644
tracetype.go
2.279 KB
4 Dec 2025 6.06 PM
root / root
0644
type.go
17.42 KB
4 Dec 2025 6.06 PM
root / root
0644
typekind.go
0.348 KB
4 Dec 2025 6.06 PM
root / root
0644
unsafe.go
3.17 KB
4 Dec 2025 6.06 PM
root / root
0644
utf8.go
3.386 KB
4 Dec 2025 6.06 PM
root / root
0644
valgrind.go
5.013 KB
4 Dec 2025 6.06 PM
root / root
0644
valgrind0.go
1.116 KB
4 Dec 2025 6.06 PM
root / root
0644
valgrind_amd64.s
1.266 KB
4 Dec 2025 6.06 PM
root / root
0644
valgrind_arm64.s
0.763 KB
4 Dec 2025 6.06 PM
root / root
0644
vdso_elf32.go
2.761 KB
4 Dec 2025 6.06 PM
root / root
0644
vdso_elf64.go
2.836 KB
4 Dec 2025 6.06 PM
root / root
0644
vdso_freebsd.go
2.443 KB
4 Dec 2025 6.06 PM
root / root
0644
vdso_freebsd_arm.go
0.443 KB
4 Dec 2025 6.06 PM
root / root
0644
vdso_freebsd_arm64.go
0.443 KB
4 Dec 2025 6.06 PM
root / root
0644
vdso_freebsd_riscv64.go
0.419 KB
4 Dec 2025 6.06 PM
root / root
0644
vdso_freebsd_x86.go
1.856 KB
4 Dec 2025 6.06 PM
root / root
0644
vdso_in_none.go
0.433 KB
4 Dec 2025 6.06 PM
root / root
0644
vdso_linux.go
7.786 KB
4 Dec 2025 6.06 PM
root / root
0644
vdso_linux_386.go
0.653 KB
4 Dec 2025 6.06 PM
root / root
0644
vdso_linux_amd64.go
0.888 KB
4 Dec 2025 6.06 PM
root / root
0644
vdso_linux_arm.go
0.653 KB
4 Dec 2025 6.06 PM
root / root
0644
vdso_linux_arm64.go
0.712 KB
4 Dec 2025 6.06 PM
root / root
0644
vdso_linux_loong64.go
0.824 KB
4 Dec 2025 6.06 PM
root / root
0644
vdso_linux_mips64x.go
0.83 KB
4 Dec 2025 6.06 PM
root / root
0644
vdso_linux_ppc64x.go
0.709 KB
4 Dec 2025 6.06 PM
root / root
0644
vdso_linux_riscv64.go
0.65 KB
4 Dec 2025 6.06 PM
root / root
0644
vdso_linux_s390x.go
0.696 KB
4 Dec 2025 6.06 PM
root / root
0644
vgetrandom_linux.go
3.825 KB
4 Dec 2025 6.06 PM
root / root
0644
vgetrandom_unsupported.go
0.45 KB
4 Dec 2025 6.06 PM
root / root
0644
vlop_386.s
2.018 KB
4 Dec 2025 6.06 PM
root / root
0644
vlop_arm.s
7.063 KB
4 Dec 2025 6.06 PM
root / root
0644
vlrt.go
6.712 KB
4 Dec 2025 6.06 PM
root / root
0644
wincallback.go
3.454 KB
4 Dec 2025 6.06 PM
root / root
0644
write_err.go
0.289 KB
4 Dec 2025 6.06 PM
root / root
0644
write_err_android.go
4.59 KB
4 Dec 2025 6.06 PM
root / root
0644
zcallback_windows.go
0.151 KB
4 Dec 2025 6.06 PM
root / root
0644
zcallback_windows.s
63.057 KB
4 Dec 2025 6.06 PM
root / root
0644
zcallback_windows_arm.s
89.323 KB
4 Dec 2025 6.06 PM
root / root
0644
zcallback_windows_arm64.s
89.323 KB
4 Dec 2025 6.06 PM
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME
Static GIF