X7ROOT File Manager
Current Path:
/opt/golang/1.19.4/src/runtime
opt
/
golang
/
1.19.4
/
src
/
runtime
/
π
..
π
HACKING.md
(15.29 KB)
π
Makefile
(178 B)
π
abi_test.go
(2.83 KB)
π
alg.go
(9.45 KB)
π
align_runtime_test.go
(2.73 KB)
π
align_test.go
(5.26 KB)
π
asan
π
asan.go
(1.55 KB)
π
asan0.go
(761 B)
π
asan_amd64.s
(2.46 KB)
π
asan_arm64.s
(2.15 KB)
π
asan_riscv64.s
(1.92 KB)
π
asm.s
(278 B)
π
asm_386.s
(40.43 KB)
π
asm_amd64.h
(411 B)
π
asm_amd64.s
(57.44 KB)
π
asm_arm.s
(30.2 KB)
π
asm_arm64.s
(41.41 KB)
π
asm_loong64.s
(21.79 KB)
π
asm_mips64x.s
(22.43 KB)
π
asm_mipsx.s
(24.41 KB)
π
asm_ppc64x.h
(1023 B)
π
asm_ppc64x.s
(35.21 KB)
π
asm_riscv64.s
(26.43 KB)
π
asm_s390x.s
(26.08 KB)
π
asm_wasm.s
(9.38 KB)
π
atomic_arm64.s
(259 B)
π
atomic_loong64.s
(245 B)
π
atomic_mips64x.s
(300 B)
π
atomic_mipsx.s
(262 B)
π
atomic_pointer.go
(2.62 KB)
π
atomic_ppc64x.s
(437 B)
π
atomic_riscv64.s
(275 B)
π
auxv_none.go
(298 B)
π
callers_test.go
(8.44 KB)
π
cgo
π
cgo.go
(2 KB)
π
cgo_mmap.go
(2.4 KB)
π
cgo_ppc64x.go
(418 B)
π
cgo_sigaction.go
(3.28 KB)
π
cgocall.go
(19.12 KB)
π
cgocallback.go
(317 B)
π
cgocheck.go
(6.86 KB)
π
chan.go
(23.73 KB)
π
chan_test.go
(23.37 KB)
π
chanbarrier_test.go
(1.4 KB)
π
checkptr.go
(3.29 KB)
π
checkptr_test.go
(2.73 KB)
π
closure_test.go
(937 B)
π
compiler.go
(410 B)
π
complex.go
(1.59 KB)
π
complex_test.go
(1.05 KB)
π
conv_wasm_test.go
(2.96 KB)
π
cpuflags.go
(810 B)
π
cpuflags_amd64.go
(533 B)
π
cpuflags_arm64.go
(334 B)
π
cpuprof.go
(7.78 KB)
π
cputicks.go
(449 B)
π
crash_cgo_test.go
(18.14 KB)
π
crash_test.go
(21.77 KB)
π
crash_unix_test.go
(8.39 KB)
π
debug
π
debug.go
(3.23 KB)
π
debug_test.go
(7.98 KB)
π
debugcall.go
(6.19 KB)
π
debuglog.go
(17.87 KB)
π
debuglog_off.go
(357 B)
π
debuglog_on.go
(1.09 KB)
π
debuglog_test.go
(4.56 KB)
π
defer_test.go
(11.56 KB)
π
defs1_linux.go
(845 B)
π
defs1_netbsd_386.go
(2.83 KB)
π
defs1_netbsd_amd64.go
(3.06 KB)
π
defs1_netbsd_arm.go
(2.94 KB)
π
defs1_netbsd_arm64.go
(3.17 KB)
π
defs1_solaris_amd64.go
(4 KB)
π
defs2_linux.go
(3.51 KB)
π
defs3_linux.go
(1.09 KB)
π
defs_aix.go
(4.16 KB)
π
defs_aix_ppc64.go
(3.61 KB)
π
defs_arm_linux.go
(2.67 KB)
π
defs_darwin.go
(3.78 KB)
π
defs_darwin_amd64.go
(6.07 KB)
π
defs_darwin_arm64.go
(3.89 KB)
π
defs_dragonfly.go
(2.59 KB)
π
defs_dragonfly_amd64.go
(3.29 KB)
π
defs_freebsd.go
(3.82 KB)
π
defs_freebsd_386.go
(4.36 KB)
π
defs_freebsd_amd64.go
(4.63 KB)
π
defs_freebsd_arm.go
(3.69 KB)
π
defs_freebsd_arm64.go
(4.01 KB)
π
defs_illumos_amd64.go
(285 B)
π
defs_linux.go
(3.25 KB)
π
defs_linux_386.go
(4.42 KB)
π
defs_linux_amd64.go
(4.93 KB)
π
defs_linux_arm.go
(4.11 KB)
π
defs_linux_arm64.go
(3.86 KB)
π
defs_linux_loong64.go
(3.68 KB)
π
defs_linux_mips64x.go
(3.85 KB)
π
defs_linux_mipsx.go
(3.83 KB)
π
defs_linux_ppc64.go
(3.93 KB)
π
defs_linux_ppc64le.go
(3.93 KB)
π
defs_linux_riscv64.go
(4.06 KB)
π
defs_linux_s390x.go
(3.41 KB)
π
defs_netbsd.go
(2.72 KB)
π
defs_netbsd_386.go
(855 B)
π
defs_netbsd_amd64.go
(1.01 KB)
π
defs_netbsd_arm.go
(764 B)
π
defs_openbsd.go
(3.09 KB)
π
defs_openbsd_386.go
(2.87 KB)
π
defs_openbsd_amd64.go
(3.07 KB)
π
defs_openbsd_arm.go
(2.99 KB)
π
defs_openbsd_arm64.go
(2.74 KB)
π
defs_openbsd_mips64.go
(2.64 KB)
π
defs_plan9_386.go
(1.63 KB)
π
defs_plan9_amd64.go
(1.82 KB)
π
defs_plan9_arm.go
(1.73 KB)
π
defs_solaris.go
(3.31 KB)
π
defs_solaris_amd64.go
(1004 B)
π
defs_windows.go
(2.09 KB)
π
defs_windows_386.go
(1.98 KB)
π
defs_windows_amd64.go
(2.71 KB)
π
defs_windows_arm.go
(2.11 KB)
π
defs_windows_arm64.go
(2.63 KB)
π
duff_386.s
(8.24 KB)
π
duff_amd64.s
(5.62 KB)
π
duff_arm.s
(7.11 KB)
π
duff_arm64.s
(5.27 KB)
π
duff_loong64.s
(12 KB)
π
duff_mips64x.s
(11.28 KB)
π
duff_ppc64x.s
(7.06 KB)
π
duff_riscv64.s
(11.4 KB)
π
duff_s390x.s
(507 B)
π
env_plan9.go
(3 KB)
π
env_posix.go
(1.79 KB)
π
env_test.go
(1.16 KB)
π
error.go
(9.21 KB)
π
example_test.go
(1.55 KB)
π
export_aix_test.go
(234 B)
π
export_arm_test.go
(226 B)
π
export_darwin_test.go
(382 B)
π
export_debug_amd64_test.go
(3.6 KB)
π
export_debug_arm64_test.go
(3.49 KB)
π
export_debug_test.go
(5.05 KB)
π
export_debuglog_test.go
(1.24 KB)
π
export_linux_test.go
(550 B)
π
export_mmap_test.go
(429 B)
π
export_pipe2_test.go
(310 B)
π
export_pipe_test.go
(219 B)
π
export_solaris_test.go
(282 B)
π
export_test.go
(38.87 KB)
π
export_unix_test.go
(2.18 KB)
π
export_windows_test.go
(677 B)
π
extern.go
(13.62 KB)
π
fastlog2.go
(1.22 KB)
π
fastlog2_test.go
(784 B)
π
fastlog2table.go
(904 B)
π
float.go
(1.35 KB)
π
float_test.go
(699 B)
π
funcdata.h
(2.55 KB)
π
gc_test.go
(20.04 KB)
π
gcinfo_test.go
(5.59 KB)
π
go_tls.h
(366 B)
π
hash32.go
(1.58 KB)
π
hash64.go
(1.95 KB)
π
hash_test.go
(16.77 KB)
π
heapdump.go
(17.65 KB)
π
histogram.go
(6.19 KB)
π
histogram_test.go
(3.42 KB)
π
iface.go
(15.66 KB)
π
iface_test.go
(7.45 KB)
π
internal
π
lfstack.go
(1.77 KB)
π
lfstack_32bit.go
(532 B)
π
lfstack_64bit.go
(2.18 KB)
π
lfstack_test.go
(2.77 KB)
π
libfuzzer.go
(6.5 KB)
π
libfuzzer_amd64.s
(5.01 KB)
π
libfuzzer_arm64.s
(3.15 KB)
π
lock_futex.go
(5.19 KB)
π
lock_js.go
(6.14 KB)
π
lock_sema.go
(6.74 KB)
π
lockrank.go
(13.26 KB)
π
lockrank_off.go
(1.14 KB)
π
lockrank_on.go
(9.83 KB)
π
lockrank_test.go
(1.15 KB)
π
malloc.go
(51.01 KB)
π
malloc_test.go
(10.78 KB)
π
map.go
(43.52 KB)
π
map_benchmark_test.go
(10.48 KB)
π
map_fast32.go
(12.72 KB)
π
map_fast64.go
(12.91 KB)
π
map_faststr.go
(14.3 KB)
π
map_test.go
(27.44 KB)
π
mbarrier.go
(12.43 KB)
π
mbitmap.go
(66.08 KB)
π
mcache.go
(10 KB)
π
mcentral.go
(7.9 KB)
π
mcheckmark.go
(2.81 KB)
π
mem.go
(6.23 KB)
π
mem_aix.go
(1.9 KB)
π
mem_bsd.go
(2.03 KB)
π
mem_darwin.go
(1.84 KB)
π
mem_js.go
(2.25 KB)
π
mem_linux.go
(6.15 KB)
π
mem_plan9.go
(4.32 KB)
π
mem_windows.go
(3.76 KB)
π
memclr_386.s
(2.38 KB)
π
memclr_amd64.s
(4.91 KB)
π
memclr_arm.s
(2.6 KB)
π
memclr_arm64.s
(3.62 KB)
π
memclr_loong64.s
(778 B)
π
memclr_mips64x.s
(1.72 KB)
π
memclr_mipsx.s
(1.32 KB)
π
memclr_plan9_386.s
(983 B)
π
memclr_plan9_amd64.s
(511 B)
π
memclr_ppc64x.s
(4.23 KB)
π
memclr_riscv64.s
(978 B)
π
memclr_s390x.s
(1.96 KB)
π
memclr_wasm.s
(622 B)
π
memmove_386.s
(4.42 KB)
π
memmove_amd64.s
(12.48 KB)
π
memmove_arm.s
(5.9 KB)
π
memmove_arm64.s
(5.96 KB)
π
memmove_linux_amd64_test.go
(1.6 KB)
π
memmove_loong64.s
(1.8 KB)
π
memmove_mips64x.s
(1.83 KB)
π
memmove_mipsx.s
(4.4 KB)
π
memmove_plan9_386.s
(3.06 KB)
π
memmove_plan9_amd64.s
(3.04 KB)
π
memmove_ppc64x.s
(4.58 KB)
π
memmove_riscv64.s
(1.86 KB)
π
memmove_s390x.s
(2.92 KB)
π
memmove_test.go
(14.03 KB)
π
memmove_wasm.s
(1.74 KB)
π
metrics
π
metrics.go
(18.71 KB)
π
metrics_test.go
(14.74 KB)
π
mfinal.go
(16.34 KB)
π
mfinal_test.go
(6.19 KB)
π
mfixalloc.go
(3.07 KB)
π
mgc.go
(56.37 KB)
π
mgclimit.go
(17.26 KB)
π
mgclimit_test.go
(9.02 KB)
π
mgcmark.go
(47.47 KB)
π
mgcpacer.go
(60.12 KB)
π
mgcpacer_test.go
(40.43 KB)
π
mgcscavenge.go
(41.29 KB)
π
mgcscavenge_test.go
(20.33 KB)
π
mgcstack.go
(10.58 KB)
π
mgcsweep.go
(27.89 KB)
π
mgcwork.go
(12.86 KB)
π
mheap.go
(69.14 KB)
π
mkduff.go
(8.01 KB)
π
mkfastlog2table.go
(3.08 KB)
π
mkpreempt.go
(15.12 KB)
π
mksizeclasses.go
(9.3 KB)
π
mmap.go
(821 B)
π
mpagealloc.go
(36.84 KB)
π
mpagealloc_32bit.go
(3.81 KB)
π
mpagealloc_64bit.go
(9.44 KB)
π
mpagealloc_test.go
(32.59 KB)
π
mpagecache.go
(5.46 KB)
π
mpagecache_test.go
(10.79 KB)
π
mpallocbits.go
(12.6 KB)
π
mpallocbits_test.go
(13.69 KB)
π
mprof.go
(38.51 KB)
π
mranges.go
(13.64 KB)
π
mranges_test.go
(5.68 KB)
π
msan
π
msan.go
(1.5 KB)
π
msan0.go
(725 B)
π
msan_amd64.s
(2.31 KB)
π
msan_arm64.s
(1.99 KB)
π
msize.go
(777 B)
π
mspanset.go
(12.21 KB)
π
mstats.go
(30.07 KB)
π
mwbbuf.go
(9.28 KB)
π
nbpipe_fcntl_libc_test.go
(470 B)
π
nbpipe_fcntl_unix_test.go
(458 B)
π
nbpipe_pipe.go
(405 B)
π
nbpipe_pipe2.go
(344 B)
π
nbpipe_pipe_test.go
(706 B)
π
nbpipe_test.go
(1.68 KB)
π
net_plan9.go
(645 B)
π
netpoll.go
(18.27 KB)
π
netpoll_aix.go
(4.83 KB)
π
netpoll_epoll.go
(4.16 KB)
π
netpoll_fake.go
(652 B)
π
netpoll_kqueue.go
(4.56 KB)
π
netpoll_os_test.go
(360 B)
π
netpoll_solaris.go
(10.76 KB)
π
netpoll_stub.go
(1.41 KB)
π
netpoll_windows.go
(3.75 KB)
π
norace_linux_test.go
(915 B)
π
norace_test.go
(983 B)
π
numcpu_freebsd_test.go
(381 B)
π
os2_aix.go
(20.45 KB)
π
os2_freebsd.go
(302 B)
π
os2_openbsd.go
(296 B)
π
os2_plan9.go
(1.48 KB)
π
os2_solaris.go
(320 B)
π
os3_plan9.go
(3.93 KB)
π
os3_solaris.go
(17.22 KB)
π
os_aix.go
(8.61 KB)
π
os_android.go
(463 B)
π
os_darwin.go
(12 KB)
π
os_darwin_arm64.go
(416 B)
π
os_dragonfly.go
(6.96 KB)
π
os_freebsd.go
(11.61 KB)
π
os_freebsd2.go
(603 B)
π
os_freebsd_amd64.go
(658 B)
π
os_freebsd_arm.go
(1.32 KB)
π
os_freebsd_arm64.go
(398 B)
π
os_freebsd_noauxv.go
(241 B)
π
os_illumos.go
(3.93 KB)
π
os_js.go
(3.28 KB)
π
os_linux.go
(26.14 KB)
π
os_linux_arm.go
(1.35 KB)
π
os_linux_arm64.go
(556 B)
π
os_linux_be64.go
(824 B)
π
os_linux_generic.go
(888 B)
π
os_linux_loong64.go
(485 B)
π
os_linux_mips64x.go
(1.07 KB)
π
os_linux_mipsx.go
(1.06 KB)
π
os_linux_noauxv.go
(337 B)
π
os_linux_novdso.go
(347 B)
π
os_linux_ppc64x.go
(526 B)
π
os_linux_riscv64.go
(198 B)
π
os_linux_s390x.go
(316 B)
π
os_linux_x86.go
(234 B)
π
os_netbsd.go
(9.8 KB)
π
os_netbsd_386.go
(617 B)
π
os_netbsd_amd64.go
(614 B)
π
os_netbsd_arm.go
(1.16 KB)
π
os_netbsd_arm64.go
(856 B)
π
os_nonopenbsd.go
(437 B)
π
os_only_solaris.go
(357 B)
π
os_openbsd.go
(6.55 KB)
π
os_openbsd_arm.go
(749 B)
π
os_openbsd_arm64.go
(416 B)
π
os_openbsd_libc.go
(1.71 KB)
π
os_openbsd_mips64.go
(416 B)
π
os_openbsd_syscall.go
(1.27 KB)
π
os_openbsd_syscall1.go
(441 B)
π
os_openbsd_syscall2.go
(2.46 KB)
π
os_plan9.go
(10.3 KB)
π
os_plan9_arm.go
(462 B)
π
os_solaris.go
(6.55 KB)
π
os_windows.go
(44.43 KB)
π
os_windows_arm.go
(511 B)
π
os_windows_arm64.go
(339 B)
π
panic.go
(40.25 KB)
π
panic32.go
(4.8 KB)
π
panic_test.go
(1.71 KB)
π
plugin.go
(4.26 KB)
π
pprof
π
preempt.go
(15.21 KB)
π
preempt_386.s
(824 B)
π
preempt_amd64.s
(1.62 KB)
π
preempt_arm.s
(1.48 KB)
π
preempt_arm64.s
(1.97 KB)
π
preempt_loong64.s
(2.35 KB)
π
preempt_mips64x.s
(2.72 KB)
π
preempt_mipsx.s
(2.68 KB)
π
preempt_nonwindows.go
(290 B)
π
preempt_ppc64x.s
(2.72 KB)
π
preempt_riscv64.s
(2.26 KB)
π
preempt_s390x.s
(1.01 KB)
π
preempt_wasm.s
(176 B)
π
print.go
(5.95 KB)
π
proc.go
(176.84 KB)
π
proc_runtime_test.go
(1.38 KB)
π
proc_test.go
(25.66 KB)
π
profbuf.go
(18.26 KB)
π
profbuf_test.go
(8.65 KB)
π
proflabel.go
(1.52 KB)
π
race
π
race.go
(18.58 KB)
π
race0.go
(2.79 KB)
π
race_amd64.s
(13.82 KB)
π
race_arm64.s
(14.21 KB)
π
race_ppc64le.s
(17.89 KB)
π
race_s390x.s
(12 KB)
π
rand_test.go
(907 B)
π
rdebug.go
(553 B)
π
relax_stub.go
(598 B)
π
rt0_aix_ppc64.s
(4.33 KB)
π
rt0_android_386.s
(822 B)
π
rt0_android_amd64.s
(754 B)
π
rt0_android_arm.s
(843 B)
π
rt0_android_arm64.s
(941 B)
π
rt0_darwin_amd64.s
(399 B)
π
rt0_darwin_arm64.s
(1.69 KB)
π
rt0_dragonfly_amd64.s
(448 B)
π
rt0_freebsd_386.s
(454 B)
π
rt0_freebsd_amd64.s
(442 B)
π
rt0_freebsd_arm.s
(298 B)
π
rt0_freebsd_arm64.s
(1.88 KB)
π
rt0_illumos_amd64.s
(311 B)
π
rt0_ios_amd64.s
(425 B)
π
rt0_ios_arm64.s
(425 B)
π
rt0_js_wasm.s
(2.3 KB)
π
rt0_linux_386.s
(450 B)
π
rt0_linux_amd64.s
(307 B)
π
rt0_linux_arm.s
(1007 B)
π
rt0_linux_arm64.s
(1.81 KB)
π
rt0_linux_loong64.s
(716 B)
π
rt0_linux_mips64x.s
(1014 B)
π
rt0_linux_mipsx.s
(797 B)
π
rt0_linux_ppc64.s
(928 B)
π
rt0_linux_ppc64le.s
(4.35 KB)
π
rt0_linux_riscv64.s
(2.65 KB)
π
rt0_linux_s390x.s
(676 B)
π
rt0_netbsd_386.s
(452 B)
π
rt0_netbsd_amd64.s
(309 B)
π
rt0_netbsd_arm.s
(296 B)
π
rt0_netbsd_arm64.s
(1.8 KB)
π
rt0_openbsd_386.s
(454 B)
π
rt0_openbsd_amd64.s
(311 B)
π
rt0_openbsd_arm.s
(298 B)
π
rt0_openbsd_arm64.s
(1.96 KB)
π
rt0_openbsd_mips64.s
(976 B)
π
rt0_plan9_386.s
(523 B)
π
rt0_plan9_amd64.s
(481 B)
π
rt0_plan9_arm.s
(397 B)
π
rt0_solaris_amd64.s
(311 B)
π
rt0_windows_386.s
(1.28 KB)
π
rt0_windows_amd64.s
(986 B)
π
rt0_windows_arm.s
(386 B)
π
rt0_windows_arm64.s
(725 B)
π
runtime-gdb.py
(15.33 KB)
π
runtime-gdb_test.go
(20.93 KB)
π
runtime-lldb_test.go
(4.95 KB)
π
runtime.go
(1.45 KB)
π
runtime1.go
(13.06 KB)
π
runtime2.go
(43.07 KB)
π
runtime_boring.go
(606 B)
π
runtime_linux_test.go
(1.95 KB)
π
runtime_mmap_test.go
(1.77 KB)
π
runtime_test.go
(11.79 KB)
π
runtime_unix_test.go
(1.22 KB)
π
rwmutex.go
(3.53 KB)
π
rwmutex_test.go
(4.19 KB)
π
select.go
(14.84 KB)
π
sema.go
(16.16 KB)
π
sema_test.go
(4.21 KB)
π
semasleep_test.go
(3.05 KB)
π
sigaction.go
(489 B)
π
signal_386.go
(1.72 KB)
π
signal_aix_ppc64.go
(3.55 KB)
π
signal_amd64.go
(2.73 KB)
π
signal_arm.go
(2.54 KB)
π
signal_arm64.go
(3.21 KB)
π
signal_darwin.go
(2.13 KB)
π
signal_darwin_amd64.go
(4 KB)
π
signal_darwin_arm64.go
(3.6 KB)
π
signal_dragonfly.go
(2.17 KB)
π
signal_dragonfly_amd64.go
(2.01 KB)
π
signal_freebsd.go
(2.2 KB)
π
signal_freebsd_386.go
(1.55 KB)
π
signal_freebsd_amd64.go
(2.03 KB)
π
signal_freebsd_arm.go
(2.18 KB)
π
signal_freebsd_arm64.go
(3.23 KB)
π
signal_linux_386.go
(1.59 KB)
π
signal_linux_amd64.go
(2.05 KB)
π
signal_linux_arm.go
(2.12 KB)
π
signal_linux_arm64.go
(2.95 KB)
π
signal_linux_loong64.go
(3.22 KB)
π
signal_linux_mips64x.go
(3.35 KB)
π
signal_linux_mipsx.go
(3.67 KB)
π
signal_linux_ppc64x.go
(3.42 KB)
π
signal_linux_riscv64.go
(2.92 KB)
π
signal_linux_s390x.go
(4.49 KB)
π
signal_loong64.go
(3.09 KB)
π
signal_mips64x.go
(3.18 KB)
π
signal_mipsx.go
(3.06 KB)
π
signal_netbsd.go
(2.18 KB)
π
signal_netbsd_386.go
(1.76 KB)
π
signal_netbsd_amd64.go
(2.33 KB)
π
signal_netbsd_arm.go
(2.3 KB)
π
signal_netbsd_arm64.go
(3.4 KB)
π
signal_openbsd.go
(2.18 KB)
π
signal_openbsd_386.go
(1.58 KB)
π
signal_openbsd_amd64.go
(2.04 KB)
π
signal_openbsd_arm.go
(2.12 KB)
π
signal_openbsd_arm64.go
(3.38 KB)
π
signal_openbsd_mips64.go
(3.28 KB)
π
signal_plan9.go
(1.93 KB)
π
signal_ppc64x.go
(3.64 KB)
π
signal_riscv64.go
(2.89 KB)
π
signal_solaris.go
(4.5 KB)
π
signal_solaris_amd64.go
(2.47 KB)
π
signal_unix.go
(41.88 KB)
π
signal_windows.go
(9.27 KB)
π
signal_windows_test.go
(5.29 KB)
π
sigqueue.go
(7.66 KB)
π
sigqueue_note.go
(648 B)
π
sigqueue_plan9.go
(3.25 KB)
π
sigtab_aix.go
(11.3 KB)
π
sigtab_linux_generic.go
(3.52 KB)
π
sigtab_linux_mipsx.go
(5.95 KB)
π
sizeclasses.go
(9.14 KB)
π
sizeof_test.go
(893 B)
π
slice.go
(9.87 KB)
π
slice_test.go
(10.32 KB)
π
softfloat64.go
(11.54 KB)
π
softfloat64_test.go
(4.04 KB)
π
stack.go
(45.05 KB)
π
stack_test.go
(22.39 KB)
π
string.go
(13.18 KB)
π
string_test.go
(12.61 KB)
π
stubs.go
(19.37 KB)
π
stubs2.go
(1.13 KB)
π
stubs3.go
(274 B)
π
stubs_386.go
(550 B)
π
stubs_amd64.go
(1.2 KB)
π
stubs_arm.go
(531 B)
π
stubs_arm64.go
(555 B)
π
stubs_linux.go
(650 B)
π
stubs_loong64.go
(276 B)
π
stubs_mips64x.go
(364 B)
π
stubs_mipsx.go
(283 B)
π
stubs_nonlinux.go
(298 B)
π
stubs_ppc64.go
(301 B)
π
stubs_ppc64x.go
(453 B)
π
stubs_riscv64.go
(460 B)
π
stubs_s390x.go
(256 B)
π
symtab.go
(35.81 KB)
π
symtab_test.go
(7.48 KB)
π
sys_aix_ppc64.s
(7.42 KB)
π
sys_arm.go
(521 B)
π
sys_arm64.go
(469 B)
π
sys_darwin.go
(17.92 KB)
π
sys_darwin_amd64.s
(19.12 KB)
π
sys_darwin_arm64.go
(1.74 KB)
π
sys_darwin_arm64.s
(15.95 KB)
π
sys_dragonfly_amd64.s
(8.03 KB)
π
sys_freebsd_386.s
(8.41 KB)
π
sys_freebsd_amd64.s
(10.7 KB)
π
sys_freebsd_arm.s
(10.12 KB)
π
sys_freebsd_arm64.s
(9.4 KB)
π
sys_libc.go
(1.84 KB)
π
sys_linux_386.s
(18.31 KB)
π
sys_linux_amd64.s
(16.57 KB)
π
sys_linux_arm.s
(16.12 KB)
π
sys_linux_arm64.s
(18.09 KB)
π
sys_linux_loong64.s
(12.15 KB)
π
sys_linux_mips64x.s
(13.5 KB)
π
sys_linux_mipsx.s
(11.09 KB)
π
sys_linux_ppc64x.s
(22.1 KB)
π
sys_linux_riscv64.s
(12.59 KB)
π
sys_linux_s390x.s
(13.78 KB)
π
sys_loong64.go
(489 B)
π
sys_mips64x.go
(500 B)
π
sys_mipsx.go
(496 B)
π
sys_netbsd_386.s
(9.55 KB)
π
sys_netbsd_amd64.s
(9.51 KB)
π
sys_netbsd_arm.s
(10.41 KB)
π
sys_netbsd_arm64.s
(9.38 KB)
π
sys_nonppc64x.go
(245 B)
π
sys_openbsd.go
(2.59 KB)
π
sys_openbsd1.go
(1.23 KB)
π
sys_openbsd2.go
(8.36 KB)
π
sys_openbsd3.go
(3.37 KB)
π
sys_openbsd_386.s
(20.03 KB)
π
sys_openbsd_amd64.s
(16.64 KB)
π
sys_openbsd_arm.s
(18.15 KB)
π
sys_openbsd_arm64.s
(14.84 KB)
π
sys_openbsd_mips64.s
(8.6 KB)
π
sys_plan9_386.s
(4.48 KB)
π
sys_plan9_amd64.s
(4.55 KB)
π
sys_plan9_arm.s
(7.03 KB)
π
sys_ppc64x.go
(532 B)
π
sys_riscv64.go
(469 B)
π
sys_s390x.go
(469 B)
π
sys_solaris_amd64.s
(6.42 KB)
π
sys_wasm.go
(754 B)
π
sys_wasm.s
(2.65 KB)
π
sys_windows_386.s
(7.65 KB)
π
sys_windows_amd64.s
(8.88 KB)
π
sys_windows_arm.s
(11.97 KB)
π
sys_windows_arm64.s
(11.45 KB)
π
sys_x86.go
(552 B)
π
syscall2_solaris.go
(1.65 KB)
π
syscall_aix.go
(6 KB)
π
syscall_solaris.go
(8.01 KB)
π
syscall_windows.go
(16.95 KB)
π
syscall_windows_test.go
(32.96 KB)
π
testdata
π
textflag.h
(1.52 KB)
π
time.go
(30.75 KB)
π
time_fake.go
(2.5 KB)
π
time_linux_amd64.s
(2.02 KB)
π
time_nofake.go
(709 B)
π
time_test.go
(2.03 KB)
π
time_windows.h
(753 B)
π
time_windows_386.s
(1.79 KB)
π
time_windows_amd64.s
(871 B)
π
time_windows_arm.s
(2.1 KB)
π
time_windows_arm64.s
(1021 B)
π
timeasm.go
(418 B)
π
timestub.go
(532 B)
π
timestub2.go
(314 B)
π
tls_arm.s
(3.45 KB)
π
tls_arm64.h
(1.1 KB)
π
tls_arm64.s
(1.2 KB)
π
tls_loong64.s
(589 B)
π
tls_mips64x.s
(733 B)
π
tls_mipsx.s
(709 B)
π
tls_ppc64x.s
(1.5 KB)
π
tls_riscv64.s
(726 B)
π
tls_s390x.s
(1.55 KB)
π
tls_stub.go
(260 B)
π
tls_windows_amd64.go
(294 B)
π
trace
π
trace.go
(45.8 KB)
π
traceback.go
(48.18 KB)
π
traceback_test.go
(11.64 KB)
π
type.go
(17.43 KB)
π
typekind.go
(742 B)
π
utf8.go
(3.39 KB)
π
vdso_elf32.go
(2.76 KB)
π
vdso_elf64.go
(2.84 KB)
π
vdso_freebsd.go
(2.44 KB)
π
vdso_freebsd_arm.go
(454 B)
π
vdso_freebsd_arm64.go
(443 B)
π
vdso_freebsd_x86.go
(1.85 KB)
π
vdso_in_none.go
(443 B)
π
vdso_linux.go
(7.77 KB)
π
vdso_linux_386.go
(669 B)
π
vdso_linux_amd64.go
(685 B)
π
vdso_linux_arm.go
(669 B)
π
vdso_linux_arm64.go
(670 B)
π
vdso_linux_loong64.go
(793 B)
π
vdso_linux_mips64x.go
(850 B)
π
vdso_linux_ppc64x.go
(672 B)
π
vdso_linux_riscv64.go
(666 B)
π
vdso_linux_s390x.go
(681 B)
π
vlop_386.s
(2.02 KB)
π
vlop_arm.s
(7.06 KB)
π
vlop_arm_test.go
(3.75 KB)
π
vlrt.go
(6.71 KB)
π
wincallback.go
(3.45 KB)
π
write_err.go
(291 B)
π
write_err_android.go
(4.65 KB)
π
zcallback_windows.go
(155 B)
π
zcallback_windows.s
(63.02 KB)
π
zcallback_windows_arm.s
(89.32 KB)
π
zcallback_windows_arm64.s
(89.32 KB)
Editing: mfinal.go
// Copyright 2009 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. // Garbage collector: finalizers and block profiling. package runtime import ( "internal/abi" "internal/goarch" "runtime/internal/atomic" "unsafe" ) // finblock is an array of finalizers to be executed. finblocks are // arranged in a linked list for the finalizer queue. // // finblock is allocated from non-GC'd memory, so any heap pointers // must be specially handled. GC currently assumes that the finalizer // queue does not grow during marking (but it can shrink). // //go:notinheap type finblock struct { alllink *finblock next *finblock cnt uint32 _ int32 fin [(_FinBlockSize - 2*goarch.PtrSize - 2*4) / unsafe.Sizeof(finalizer{})]finalizer } var finlock mutex // protects the following variables var fing *g // goroutine that runs finalizers var finq *finblock // list of finalizers that are to be executed var finc *finblock // cache of free blocks var finptrmask [_FinBlockSize / goarch.PtrSize / 8]byte var fingwait bool var fingwake bool var allfin *finblock // list of all blocks // NOTE: Layout known to queuefinalizer. type finalizer struct { fn *funcval // function to call (may be a heap pointer) arg unsafe.Pointer // ptr to object (may be a heap pointer) nret uintptr // bytes of return values from fn fint *_type // type of first argument of fn ot *ptrtype // type of ptr to object (may be a heap pointer) } var finalizer1 = [...]byte{ // Each Finalizer is 5 words, ptr ptr INT ptr ptr (INT = uintptr here) // Each byte describes 8 words. // Need 8 Finalizers described by 5 bytes before pattern repeats: // ptr ptr INT ptr ptr // ptr ptr INT ptr ptr // ptr ptr INT ptr ptr // ptr ptr INT ptr ptr // ptr ptr INT ptr ptr // ptr ptr INT ptr ptr // ptr ptr INT ptr ptr // ptr ptr INT ptr ptr // aka // // ptr ptr INT ptr ptr ptr ptr INT // ptr ptr ptr ptr INT ptr ptr ptr // ptr INT ptr ptr ptr ptr INT ptr // ptr ptr ptr INT ptr ptr ptr ptr // INT ptr ptr ptr ptr INT ptr ptr // // Assumptions about Finalizer layout checked below. 1<<0 | 1<<1 | 0<<2 | 1<<3 | 1<<4 | 1<<5 | 1<<6 | 0<<7, 1<<0 | 1<<1 | 1<<2 | 1<<3 | 0<<4 | 1<<5 | 1<<6 | 1<<7, 1<<0 | 0<<1 | 1<<2 | 1<<3 | 1<<4 | 1<<5 | 0<<6 | 1<<7, 1<<0 | 1<<1 | 1<<2 | 0<<3 | 1<<4 | 1<<5 | 1<<6 | 1<<7, 0<<0 | 1<<1 | 1<<2 | 1<<3 | 1<<4 | 0<<5 | 1<<6 | 1<<7, } func queuefinalizer(p unsafe.Pointer, fn *funcval, nret uintptr, fint *_type, ot *ptrtype) { if gcphase != _GCoff { // Currently we assume that the finalizer queue won't // grow during marking so we don't have to rescan it // during mark termination. If we ever need to lift // this assumption, we can do it by adding the // necessary barriers to queuefinalizer (which it may // have automatically). throw("queuefinalizer during GC") } lock(&finlock) if finq == nil || finq.cnt == uint32(len(finq.fin)) { if finc == nil { finc = (*finblock)(persistentalloc(_FinBlockSize, 0, &memstats.gcMiscSys)) finc.alllink = allfin allfin = finc if finptrmask[0] == 0 { // Build pointer mask for Finalizer array in block. // Check assumptions made in finalizer1 array above. if (unsafe.Sizeof(finalizer{}) != 5*goarch.PtrSize || unsafe.Offsetof(finalizer{}.fn) != 0 || unsafe.Offsetof(finalizer{}.arg) != goarch.PtrSize || unsafe.Offsetof(finalizer{}.nret) != 2*goarch.PtrSize || unsafe.Offsetof(finalizer{}.fint) != 3*goarch.PtrSize || unsafe.Offsetof(finalizer{}.ot) != 4*goarch.PtrSize) { throw("finalizer out of sync") } for i := range finptrmask { finptrmask[i] = finalizer1[i%len(finalizer1)] } } } block := finc finc = block.next block.next = finq finq = block } f := &finq.fin[finq.cnt] atomic.Xadd(&finq.cnt, +1) // Sync with markroots f.fn = fn f.nret = nret f.fint = fint f.ot = ot f.arg = p fingwake = true unlock(&finlock) } //go:nowritebarrier func iterate_finq(callback func(*funcval, unsafe.Pointer, uintptr, *_type, *ptrtype)) { for fb := allfin; fb != nil; fb = fb.alllink { for i := uint32(0); i < fb.cnt; i++ { f := &fb.fin[i] callback(f.fn, f.arg, f.nret, f.fint, f.ot) } } } func wakefing() *g { var res *g lock(&finlock) if fingwait && fingwake { fingwait = false fingwake = false res = fing } unlock(&finlock) return res } var ( fingCreate uint32 fingRunning bool ) func createfing() { // start the finalizer goroutine exactly once if fingCreate == 0 && atomic.Cas(&fingCreate, 0, 1) { go runfinq() } } // This is the goroutine that runs all of the finalizers func runfinq() { var ( frame unsafe.Pointer framecap uintptr argRegs int ) gp := getg() lock(&finlock) fing = gp unlock(&finlock) for { lock(&finlock) fb := finq finq = nil if fb == nil { fingwait = true goparkunlock(&finlock, waitReasonFinalizerWait, traceEvGoBlock, 1) continue } argRegs = intArgRegs unlock(&finlock) if raceenabled { racefingo() } for fb != nil { for i := fb.cnt; i > 0; i-- { f := &fb.fin[i-1] var regs abi.RegArgs // The args may be passed in registers or on stack. Even for // the register case, we still need the spill slots. // TODO: revisit if we remove spill slots. // // Unfortunately because we can have an arbitrary // amount of returns and it would be complex to try and // figure out how many of those can get passed in registers, // just conservatively assume none of them do. framesz := unsafe.Sizeof((any)(nil)) + f.nret if framecap < framesz { // The frame does not contain pointers interesting for GC, // all not yet finalized objects are stored in finq. // If we do not mark it as FlagNoScan, // the last finalized object is not collected. frame = mallocgc(framesz, nil, true) framecap = framesz } if f.fint == nil { throw("missing type in runfinq") } r := frame if argRegs > 0 { r = unsafe.Pointer(®s.Ints) } else { // frame is effectively uninitialized // memory. That means we have to clear // it before writing to it to avoid // confusing the write barrier. *(*[2]uintptr)(frame) = [2]uintptr{} } switch f.fint.kind & kindMask { case kindPtr: // direct use of pointer *(*unsafe.Pointer)(r) = f.arg case kindInterface: ityp := (*interfacetype)(unsafe.Pointer(f.fint)) // set up with empty interface (*eface)(r)._type = &f.ot.typ (*eface)(r).data = f.arg if len(ityp.mhdr) != 0 { // convert to interface with methods // this conversion is guaranteed to succeed - we checked in SetFinalizer (*iface)(r).tab = assertE2I(ityp, (*eface)(r)._type) } default: throw("bad kind in runfinq") } fingRunning = true reflectcall(nil, unsafe.Pointer(f.fn), frame, uint32(framesz), uint32(framesz), uint32(framesz), ®s) fingRunning = false // Drop finalizer queue heap references // before hiding them from markroot. // This also ensures these will be // clear if we reuse the finalizer. f.fn = nil f.arg = nil f.ot = nil atomic.Store(&fb.cnt, i-1) } next := fb.next lock(&finlock) fb.next = finc finc = fb unlock(&finlock) fb = next } } } // SetFinalizer sets the finalizer associated with obj to the provided // finalizer function. When the garbage collector finds an unreachable block // with an associated finalizer, it clears the association and runs // finalizer(obj) in a separate goroutine. This makes obj reachable again, // but now without an associated finalizer. Assuming that SetFinalizer // is not called again, the next time the garbage collector sees // that obj is unreachable, it will free obj. // // SetFinalizer(obj, nil) clears any finalizer associated with obj. // // The argument obj must be a pointer to an object allocated by calling // new, by taking the address of a composite literal, or by taking the // address of a local variable. // The argument finalizer must be a function that takes a single argument // to which obj's type can be assigned, and can have arbitrary ignored return // values. If either of these is not true, SetFinalizer may abort the // program. // // Finalizers are run in dependency order: if A points at B, both have // finalizers, and they are otherwise unreachable, only the finalizer // for A runs; once A is freed, the finalizer for B can run. // If a cyclic structure includes a block with a finalizer, that // cycle is not guaranteed to be garbage collected and the finalizer // is not guaranteed to run, because there is no ordering that // respects the dependencies. // // The finalizer is scheduled to run at some arbitrary time after the // program can no longer reach the object to which obj points. // There is no guarantee that finalizers will run before a program exits, // so typically they are useful only for releasing non-memory resources // associated with an object during a long-running program. // For example, an os.File object could use a finalizer to close the // associated operating system file descriptor when a program discards // an os.File without calling Close, but it would be a mistake // to depend on a finalizer to flush an in-memory I/O buffer such as a // bufio.Writer, because the buffer would not be flushed at program exit. // // It is not guaranteed that a finalizer will run if the size of *obj is // zero bytes. // // It is not guaranteed that a finalizer will run for objects allocated // in initializers for package-level variables. Such objects may be // linker-allocated, not heap-allocated. // // A finalizer may run as soon as an object becomes unreachable. // In order to use finalizers correctly, the program must ensure that // the object is reachable until it is no longer required. // Objects stored in global variables, or that can be found by tracing // pointers from a global variable, are reachable. For other objects, // pass the object to a call of the KeepAlive function to mark the // last point in the function where the object must be reachable. // // For example, if p points to a struct, such as os.File, that contains // a file descriptor d, and p has a finalizer that closes that file // descriptor, and if the last use of p in a function is a call to // syscall.Write(p.d, buf, size), then p may be unreachable as soon as // the program enters syscall.Write. The finalizer may run at that moment, // closing p.d, causing syscall.Write to fail because it is writing to // a closed file descriptor (or, worse, to an entirely different // file descriptor opened by a different goroutine). To avoid this problem, // call KeepAlive(p) after the call to syscall.Write. // // A single goroutine runs all finalizers for a program, sequentially. // If a finalizer must run for a long time, it should do so by starting // a new goroutine. // // In the terminology of the Go memory model, a call // SetFinalizer(x, f) βsynchronizes beforeβ the finalization call f(x). // However, there is no guarantee that KeepAlive(x) or any other use of x // βsynchronizes beforeβ f(x), so in general a finalizer should use a mutex // or other synchronization mechanism if it needs to access mutable state in x. // For example, consider a finalizer that inspects a mutable field in x // that is modified from time to time in the main program before x // becomes unreachable and the finalizer is invoked. // The modifications in the main program and the inspection in the finalizer // need to use appropriate synchronization, such as mutexes or atomic updates, // to avoid read-write races. func SetFinalizer(obj any, finalizer any) { if debug.sbrk != 0 { // debug.sbrk never frees memory, so no finalizers run // (and we don't have the data structures to record them). return } e := efaceOf(&obj) etyp := e._type if etyp == nil { throw("runtime.SetFinalizer: first argument is nil") } if etyp.kind&kindMask != kindPtr { throw("runtime.SetFinalizer: first argument is " + etyp.string() + ", not pointer") } ot := (*ptrtype)(unsafe.Pointer(etyp)) if ot.elem == nil { throw("nil elem type!") } // find the containing object base, _, _ := findObject(uintptr(e.data), 0, 0) if base == 0 { // 0-length objects are okay. if e.data == unsafe.Pointer(&zerobase) { return } // Global initializers might be linker-allocated. // var Foo = &Object{} // func main() { // runtime.SetFinalizer(Foo, nil) // } // The relevant segments are: noptrdata, data, bss, noptrbss. // We cannot assume they are in any order or even contiguous, // due to external linking. for datap := &firstmoduledata; datap != nil; datap = datap.next { if datap.noptrdata <= uintptr(e.data) && uintptr(e.data) < datap.enoptrdata || datap.data <= uintptr(e.data) && uintptr(e.data) < datap.edata || datap.bss <= uintptr(e.data) && uintptr(e.data) < datap.ebss || datap.noptrbss <= uintptr(e.data) && uintptr(e.data) < datap.enoptrbss { return } } throw("runtime.SetFinalizer: pointer not in allocated block") } if uintptr(e.data) != base { // As an implementation detail we allow to set finalizers for an inner byte // of an object if it could come from tiny alloc (see mallocgc for details). if ot.elem == nil || ot.elem.ptrdata != 0 || ot.elem.size >= maxTinySize { throw("runtime.SetFinalizer: pointer not at beginning of allocated block") } } f := efaceOf(&finalizer) ftyp := f._type if ftyp == nil { // switch to system stack and remove finalizer systemstack(func() { removefinalizer(e.data) }) return } if ftyp.kind&kindMask != kindFunc { throw("runtime.SetFinalizer: second argument is " + ftyp.string() + ", not a function") } ft := (*functype)(unsafe.Pointer(ftyp)) if ft.dotdotdot() { throw("runtime.SetFinalizer: cannot pass " + etyp.string() + " to finalizer " + ftyp.string() + " because dotdotdot") } if ft.inCount != 1 { throw("runtime.SetFinalizer: cannot pass " + etyp.string() + " to finalizer " + ftyp.string()) } fint := ft.in()[0] switch { case fint == etyp: // ok - same type goto okarg case fint.kind&kindMask == kindPtr: if (fint.uncommon() == nil || etyp.uncommon() == nil) && (*ptrtype)(unsafe.Pointer(fint)).elem == ot.elem { // ok - not same type, but both pointers, // one or the other is unnamed, and same element type, so assignable. goto okarg } case fint.kind&kindMask == kindInterface: ityp := (*interfacetype)(unsafe.Pointer(fint)) if len(ityp.mhdr) == 0 { // ok - satisfies empty interface goto okarg } if iface := assertE2I2(ityp, *efaceOf(&obj)); iface.tab != nil { goto okarg } } throw("runtime.SetFinalizer: cannot pass " + etyp.string() + " to finalizer " + ftyp.string()) okarg: // compute size needed for return parameters nret := uintptr(0) for _, t := range ft.out() { nret = alignUp(nret, uintptr(t.align)) + uintptr(t.size) } nret = alignUp(nret, goarch.PtrSize) // make sure we have a finalizer goroutine createfing() systemstack(func() { if !addfinalizer(e.data, (*funcval)(f.data), nret, fint, ot) { throw("runtime.SetFinalizer: finalizer already set") } }) } // Mark KeepAlive as noinline so that it is easily detectable as an intrinsic. // //go:noinline // KeepAlive marks its argument as currently reachable. // This ensures that the object is not freed, and its finalizer is not run, // before the point in the program where KeepAlive is called. // // A very simplified example showing where KeepAlive is required: // // type File struct { d int } // d, err := syscall.Open("/file/path", syscall.O_RDONLY, 0) // // ... do something if err != nil ... // p := &File{d} // runtime.SetFinalizer(p, func(p *File) { syscall.Close(p.d) }) // var buf [10]byte // n, err := syscall.Read(p.d, buf[:]) // // Ensure p is not finalized until Read returns. // runtime.KeepAlive(p) // // No more uses of p after this point. // // Without the KeepAlive call, the finalizer could run at the start of // syscall.Read, closing the file descriptor before syscall.Read makes // the actual system call. // // Note: KeepAlive should only be used to prevent finalizers from // running prematurely. In particular, when used with unsafe.Pointer, // the rules for valid uses of unsafe.Pointer still apply. func KeepAlive(x any) { // Introduce a use of x that the compiler can't eliminate. // This makes sure x is alive on entry. We need x to be alive // on entry for "defer runtime.KeepAlive(x)"; see issue 21402. if cgoAlwaysFalse { println(x) } }
Upload File
Create Folder