$78 GRAYBYTE WORDPRESS FILE MANAGER $80

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/pprof/

HOME
Current File : /lib/golang/src/runtime/pprof//map.go
// Copyright 2017 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.

package pprof

import "unsafe"

// A profMap is a map from (stack, tag) to mapEntry.
// It grows without bound, but that's assumed to be OK.
type profMap struct {
	hash    map[uintptr]*profMapEntry
	all     *profMapEntry
	last    *profMapEntry
	free    []profMapEntry
	freeStk []uintptr
}

// A profMapEntry is a single entry in the profMap.
type profMapEntry struct {
	nextHash *profMapEntry // next in hash list
	nextAll  *profMapEntry // next in list of all entries
	stk      []uintptr
	tag      unsafe.Pointer
	count    int64
}

func (m *profMap) lookup(stk []uint64, tag unsafe.Pointer) *profMapEntry {
	// Compute hash of (stk, tag).
	h := uintptr(0)
	for _, x := range stk {
		h = h<<8 | (h >> (8 * (unsafe.Sizeof(h) - 1)))
		h += uintptr(x) * 41
	}
	h = h<<8 | (h >> (8 * (unsafe.Sizeof(h) - 1)))
	h += uintptr(tag) * 41

	// Find entry if present.
	var last *profMapEntry
Search:
	for e := m.hash[h]; e != nil; last, e = e, e.nextHash {
		if len(e.stk) != len(stk) || e.tag != tag {
			continue
		}
		for j := range stk {
			if e.stk[j] != uintptr(stk[j]) {
				continue Search
			}
		}
		// Move to front.
		if last != nil {
			last.nextHash = e.nextHash
			e.nextHash = m.hash[h]
			m.hash[h] = e
		}
		return e
	}

	// Add new entry.
	if len(m.free) < 1 {
		m.free = make([]profMapEntry, 128)
	}
	e := &m.free[0]
	m.free = m.free[1:]
	e.nextHash = m.hash[h]
	e.tag = tag

	if len(m.freeStk) < len(stk) {
		m.freeStk = make([]uintptr, 1024)
	}
	// Limit cap to prevent append from clobbering freeStk.
	e.stk = m.freeStk[:len(stk):len(stk)]
	m.freeStk = m.freeStk[len(stk):]

	for j := range stk {
		e.stk[j] = uintptr(stk[j])
	}
	if m.hash == nil {
		m.hash = make(map[uintptr]*profMapEntry)
	}
	m.hash[h] = e
	if m.all == nil {
		m.all = e
		m.last = e
	} else {
		m.last.nextAll = e
		m.last = e
	}
	return e
}

Current_dir [ NOT WRITEABLE ] Document_root [ WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
16 Dec 2025 9.34 PM
root / root
0755
defs_darwin.go
0.752 KB
4 Dec 2025 6.06 PM
root / root
0644
defs_darwin_amd64.go
0.595 KB
4 Dec 2025 6.06 PM
root / root
0644
defs_darwin_arm64.go
0.593 KB
4 Dec 2025 6.06 PM
root / root
0644
elf.go
2.794 KB
4 Dec 2025 6.06 PM
root / root
0644
label.go
4.02 KB
4 Dec 2025 6.06 PM
root / root
0644
map.go
1.938 KB
4 Dec 2025 6.06 PM
root / root
0644
pe.go
0.523 KB
4 Dec 2025 6.06 PM
root / root
0644
pprof.go
31.134 KB
4 Dec 2025 6.06 PM
root / root
0644
pprof_norusage.go
0.302 KB
4 Dec 2025 6.06 PM
root / root
0644
pprof_rusage.go
0.773 KB
4 Dec 2025 6.06 PM
root / root
0644
pprof_windows.go
0.493 KB
4 Dec 2025 6.06 PM
root / root
0644
proto.go
25.951 KB
4 Dec 2025 6.06 PM
root / root
0644
proto_darwin.go
1.028 KB
4 Dec 2025 6.06 PM
root / root
0644
proto_other.go
0.906 KB
4 Dec 2025 6.06 PM
root / root
0644
proto_windows.go
2.165 KB
4 Dec 2025 6.06 PM
root / root
0644
protobuf.go
2.504 KB
4 Dec 2025 6.06 PM
root / root
0644
protomem.go
2.986 KB
4 Dec 2025 6.06 PM
root / root
0644
runtime.go
1.762 KB
4 Dec 2025 6.06 PM
root / root
0644
vminfo_darwin.go
1.806 KB
4 Dec 2025 6.06 PM
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME
Static GIF