X7ROOT File Manager
Current Path:
/opt/golang/1.22.0/src/runtime
opt
/
golang
/
1.22.0
/
src
/
runtime
/
๐
..
๐
HACKING.md
(13.85 KB)
๐
Makefile
(178 B)
๐
abi_test.go
(2.83 KB)
๐
alg.go
(10.99 KB)
๐
align_runtime_test.go
(1.82 KB)
๐
align_test.go
(5.37 KB)
๐
arena.go
(31.66 KB)
๐
arena_test.go
(13.39 KB)
๐
asan
๐
asan.go
(1.55 KB)
๐
asan0.go
(760 B)
๐
asan_amd64.s
(2.45 KB)
๐
asan_arm64.s
(2.14 KB)
๐
asan_loong64.s
(2.12 KB)
๐
asan_ppc64le.s
(2.75 KB)
๐
asan_riscv64.s
(1.92 KB)
๐
asm.s
(719 B)
๐
asm_386.s
(42.54 KB)
๐
asm_amd64.h
(631 B)
๐
asm_amd64.s
(60.09 KB)
๐
asm_arm.s
(31.58 KB)
๐
asm_arm64.s
(43.33 KB)
๐
asm_loong64.s
(27.58 KB)
๐
asm_mips64x.s
(24.34 KB)
๐
asm_mipsx.s
(25.82 KB)
๐
asm_ppc64x.h
(1.93 KB)
๐
asm_ppc64x.s
(45.19 KB)
๐
asm_riscv64.s
(26.97 KB)
๐
asm_s390x.s
(27.55 KB)
๐
asm_wasm.s
(11.82 KB)
๐
atomic_arm64.s
(259 B)
๐
atomic_loong64.s
(245 B)
๐
atomic_mips64x.s
(300 B)
๐
atomic_mipsx.s
(262 B)
๐
atomic_pointer.go
(3.66 KB)
๐
atomic_ppc64x.s
(437 B)
๐
atomic_riscv64.s
(275 B)
๐
auxv_none.go
(298 B)
๐
callers_test.go
(12.13 KB)
๐
cgo
๐
cgo.go
(2.5 KB)
๐
cgo_mmap.go
(2.42 KB)
๐
cgo_ppc64x.go
(418 B)
๐
cgo_sigaction.go
(3.28 KB)
๐
cgocall.go
(23.23 KB)
๐
cgocallback.go
(317 B)
๐
cgocheck.go
(7.97 KB)
๐
chan.go
(23.74 KB)
๐
chan_test.go
(23.44 KB)
๐
chanbarrier_test.go
(1.4 KB)
๐
checkptr.go
(3.29 KB)
๐
checkptr_test.go
(2.86 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)
๐
coro.go
(4.92 KB)
๐
coverage
๐
covercounter.go
(749 B)
๐
covermeta.go
(2.4 KB)
๐
cpuflags.go
(810 B)
๐
cpuflags_amd64.go
(533 B)
๐
cpuflags_arm64.go
(312 B)
๐
cpuprof.go
(7.94 KB)
๐
cputicks.go
(437 B)
๐
crash_cgo_test.go
(23.35 KB)
๐
crash_test.go
(23.12 KB)
๐
crash_unix_test.go
(9.19 KB)
๐
create_file_nounix.go
(305 B)
๐
create_file_unix.go
(368 B)
๐
debug
๐
debug.go
(3.53 KB)
๐
debug_test.go
(7.99 KB)
๐
debugcall.go
(6.75 KB)
๐
debuglog.go
(18.24 KB)
๐
debuglog_off.go
(357 B)
๐
debuglog_on.go
(1.09 KB)
๐
debuglog_test.go
(4.9 KB)
๐
defer_test.go
(11.4 KB)
๐
defs1_linux.go
(845 B)
๐
defs1_netbsd_386.go
(2.91 KB)
๐
defs1_netbsd_amd64.go
(3.14 KB)
๐
defs1_netbsd_arm.go
(3.03 KB)
๐
defs1_netbsd_arm64.go
(3.25 KB)
๐
defs1_solaris_amd64.go
(4.01 KB)
๐
defs2_linux.go
(3.22 KB)
๐
defs3_linux.go
(1.09 KB)
๐
defs_aix.go
(4.17 KB)
๐
defs_aix_ppc64.go
(3.63 KB)
๐
defs_arm_linux.go
(2.67 KB)
๐
defs_darwin.go
(4.18 KB)
๐
defs_darwin_amd64.go
(6.34 KB)
๐
defs_darwin_arm64.go
(4.17 KB)
๐
defs_dragonfly.go
(2.73 KB)
๐
defs_dragonfly_amd64.go
(3.41 KB)
๐
defs_freebsd.go
(3.96 KB)
๐
defs_freebsd_386.go
(4.52 KB)
๐
defs_freebsd_amd64.go
(4.79 KB)
๐
defs_freebsd_arm.go
(3.92 KB)
๐
defs_freebsd_arm64.go
(4.18 KB)
๐
defs_freebsd_riscv64.go
(4.19 KB)
๐
defs_illumos_amd64.go
(285 B)
๐
defs_linux.go
(2.92 KB)
๐
defs_linux_386.go
(4.2 KB)
๐
defs_linux_amd64.go
(4.7 KB)
๐
defs_linux_arm.go
(3.89 KB)
๐
defs_linux_arm64.go
(3.62 KB)
๐
defs_linux_loong64.go
(3.43 KB)
๐
defs_linux_mips64x.go
(3.6 KB)
๐
defs_linux_mipsx.go
(3.6 KB)
๐
defs_linux_ppc64.go
(3.69 KB)
๐
defs_linux_ppc64le.go
(3.69 KB)
๐
defs_linux_riscv64.go
(3.81 KB)
๐
defs_linux_s390x.go
(3.16 KB)
๐
defs_netbsd.go
(2.83 KB)
๐
defs_netbsd_386.go
(855 B)
๐
defs_netbsd_amd64.go
(1.01 KB)
๐
defs_netbsd_arm.go
(764 B)
๐
defs_openbsd.go
(3.06 KB)
๐
defs_openbsd_386.go
(2.91 KB)
๐
defs_openbsd_amd64.go
(3.11 KB)
๐
defs_openbsd_arm.go
(3.03 KB)
๐
defs_openbsd_arm64.go
(2.78 KB)
๐
defs_openbsd_mips64.go
(2.75 KB)
๐
defs_openbsd_ppc64.go
(3 KB)
๐
defs_openbsd_riscv64.go
(2.89 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.32 KB)
๐
defs_solaris_amd64.go
(1004 B)
๐
defs_windows.go
(2.25 KB)
๐
defs_windows_386.go
(2.28 KB)
๐
defs_windows_amd64.go
(3.19 KB)
๐
defs_windows_arm.go
(2.57 KB)
๐
defs_windows_arm64.go
(3.07 KB)
๐
duff_386.s
(8.24 KB)
๐
duff_amd64.s
(5.64 KB)
๐
duff_arm.s
(7.11 KB)
๐
duff_arm64.s
(5.27 KB)
๐
duff_loong64.s
(11.9 KB)
๐
duff_mips64x.s
(11.28 KB)
๐
duff_ppc64x.s
(7.06 KB)
๐
duff_riscv64.s
(11.4 KB)
๐
duff_s390x.s
(507 B)
๐
ehooks_test.go
(2.04 KB)
๐
env_plan9.go
(3 KB)
๐
env_posix.go
(1.56 KB)
๐
env_test.go
(1.16 KB)
๐
error.go
(9.29 KB)
๐
example_test.go
(1.55 KB)
๐
exithook.go
(2.32 KB)
๐
export_aix_test.go
(207 B)
๐
export_arm_test.go
(226 B)
๐
export_darwin_test.go
(207 B)
๐
export_debug_amd64_test.go
(3.6 KB)
๐
export_debug_arm64_test.go
(3.49 KB)
๐
export_debug_ppc64le_test.go
(3.5 KB)
๐
export_debug_test.go
(5.07 KB)
๐
export_debuglog_test.go
(1.27 KB)
๐
export_linux_test.go
(378 B)
๐
export_mmap_test.go
(429 B)
๐
export_pipe2_test.go
(310 B)
๐
export_pipe_test.go
(219 B)
๐
export_test.go
(50.52 KB)
๐
export_unix_test.go
(2.27 KB)
๐
export_windows_test.go
(903 B)
๐
extern.go
(18.58 KB)
๐
fastlog2.go
(1.22 KB)
๐
fastlog2_test.go
(784 B)
๐
fastlog2table.go
(904 B)
๐
fds_nonunix.go
(256 B)
๐
fds_test.go
(1.43 KB)
๐
fds_unix.go
(1.27 KB)
๐
float.go
(1.35 KB)
๐
float_test.go
(699 B)
๐
funcdata.h
(2.53 KB)
๐
gc_test.go
(20.32 KB)
๐
gcinfo_test.go
(5.95 KB)
๐
go_tls.h
(366 B)
๐
hash32.go
(1.58 KB)
๐
hash64.go
(1.95 KB)
๐
hash_test.go
(17.24 KB)
๐
heap_test.go
(529 B)
๐
heapdump.go
(17.88 KB)
๐
histogram.go
(7.3 KB)
๐
histogram_test.go
(3.51 KB)
๐
iface.go
(20.92 KB)
๐
iface_test.go
(7.45 KB)
๐
import_test.go
(1.42 KB)
๐
importx_test.go
(763 B)
๐
internal
๐
lfstack.go
(2.03 KB)
๐
lfstack_test.go
(2.74 KB)
๐
libfuzzer.go
(6.34 KB)
๐
libfuzzer_amd64.s
(5.03 KB)
๐
libfuzzer_arm64.s
(3.15 KB)
๐
lock_futex.go
(5.4 KB)
๐
lock_js.go
(7.28 KB)
๐
lock_sema.go
(6.75 KB)
๐
lock_wasip1.go
(2.01 KB)
๐
lockrank.go
(18.19 KB)
๐
lockrank_off.go
(1.17 KB)
๐
lockrank_on.go
(10.27 KB)
๐
lockrank_test.go
(856 B)
๐
malloc.go
(58.5 KB)
๐
malloc_test.go
(10.64 KB)
๐
map.go
(52.17 KB)
๐
map_benchmark_test.go
(10.59 KB)
๐
map_fast32.go
(12.74 KB)
๐
map_fast64.go
(12.92 KB)
๐
map_faststr.go
(14.32 KB)
๐
map_test.go
(31.75 KB)
๐
mbarrier.go
(13.78 KB)
๐
mbitmap.go
(22.54 KB)
๐
mbitmap_allocheaders.go
(44.67 KB)
๐
mbitmap_noallocheaders.go
(28.95 KB)
๐
mcache.go
(10 KB)
๐
mcentral.go
(8.05 KB)
๐
mcheckmark.go
(2.85 KB)
๐
mem.go
(6.72 KB)
๐
mem_aix.go
(2.01 KB)
๐
mem_bsd.go
(2.21 KB)
๐
mem_darwin.go
(1.96 KB)
๐
mem_js.go
(457 B)
๐
mem_linux.go
(4.98 KB)
๐
mem_plan9.go
(447 B)
๐
mem_sbrk.go
(4.19 KB)
๐
mem_wasip1.go
(392 B)
๐
mem_wasm.go
(488 B)
๐
mem_windows.go
(3.88 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
(843 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.44 KB)
๐
memclr_riscv64.s
(1.71 KB)
๐
memclr_s390x.s
(1.96 KB)
๐
memclr_wasm.s
(485 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.53 KB)
๐
memmove_loong64.s
(1.87 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.91 KB)
๐
memmove_riscv64.s
(5.46 KB)
๐
memmove_s390x.s
(2.92 KB)
๐
memmove_test.go
(21.23 KB)
๐
memmove_wasm.s
(479 B)
๐
metrics
๐
metrics.go
(26.01 KB)
๐
metrics_test.go
(42.46 KB)
๐
mfinal.go
(18.91 KB)
๐
mfinal_test.go
(5.57 KB)
๐
mfixalloc.go
(3.13 KB)
๐
mgc.go
(59.29 KB)
๐
mgclimit.go
(17.28 KB)
๐
mgclimit_test.go
(9.02 KB)
๐
mgcmark.go
(53.07 KB)
๐
mgcpacer.go
(55.36 KB)
๐
mgcpacer_test.go
(39.26 KB)
๐
mgcscavenge.go
(52.32 KB)
๐
mgcscavenge_test.go
(25.2 KB)
๐
mgcstack.go
(10.58 KB)
๐
mgcsweep.go
(32.26 KB)
๐
mgcwork.go
(12.89 KB)
๐
mheap.go
(72.64 KB)
๐
minmax.go
(1.46 KB)
๐
minmax_test.go
(3.31 KB)
๐
mkduff.go
(8.04 KB)
๐
mkfastlog2table.go
(3.08 KB)
๐
mklockrank.go
(9 KB)
๐
mkpreempt.go
(15.33 KB)
๐
mksizeclasses.go
(9.52 KB)
๐
mmap.go
(844 B)
๐
mpagealloc.go
(39.23 KB)
๐
mpagealloc_32bit.go
(4.56 KB)
๐
mpagealloc_64bit.go
(9.34 KB)
๐
mpagealloc_test.go
(32.59 KB)
๐
mpagecache.go
(5.59 KB)
๐
mpagecache_test.go
(10.79 KB)
๐
mpallocbits.go
(12.58 KB)
๐
mpallocbits_test.go
(13.69 KB)
๐
mprof.go
(47.4 KB)
๐
mranges.go
(14.46 KB)
๐
mranges_test.go
(5.68 KB)
๐
msan
๐
msan.go
(1.5 KB)
๐
msan0.go
(725 B)
๐
msan_amd64.s
(2.3 KB)
๐
msan_arm64.s
(1.98 KB)
๐
msan_loong64.s
(1.96 KB)
๐
msize_allocheaders.go
(1.32 KB)
๐
msize_noallocheaders.go
(915 B)
๐
mspanset.go
(13.12 KB)
๐
mstats.go
(33.81 KB)
๐
mwbbuf.go
(8.13 KB)
๐
nbpipe_pipe.go
(405 B)
๐
nbpipe_pipe2.go
(344 B)
๐
nbpipe_pipe_test.go
(706 B)
๐
nbpipe_test.go
(1.99 KB)
๐
net_plan9.go
(645 B)
๐
netpoll.go
(20.55 KB)
๐
netpoll_aix.go
(5.06 KB)
๐
netpoll_epoll.go
(4.4 KB)
๐
netpoll_fake.go
(664 B)
๐
netpoll_kqueue.go
(5.62 KB)
๐
netpoll_os_test.go
(520 B)
๐
netpoll_solaris.go
(11.2 KB)
๐
netpoll_stub.go
(1.48 KB)
๐
netpoll_wasip1.go
(6.08 KB)
๐
netpoll_windows.go
(4.01 KB)
๐
nonwindows_stub.go
(729 B)
๐
norace_linux_test.go
(915 B)
๐
norace_test.go
(983 B)
๐
numcpu_freebsd_test.go
(381 B)
๐
os2_aix.go
(20.88 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.94 KB)
๐
os3_solaris.go
(17.59 KB)
๐
os_aix.go
(8.89 KB)
๐
os_android.go
(463 B)
๐
os_darwin.go
(11.92 KB)
๐
os_darwin_arm64.go
(329 B)
๐
os_dragonfly.go
(7.14 KB)
๐
os_freebsd.go
(11.64 KB)
๐
os_freebsd2.go
(603 B)
๐
os_freebsd_amd64.go
(658 B)
๐
os_freebsd_arm.go
(1.45 KB)
๐
os_freebsd_arm64.go
(320 B)
๐
os_freebsd_noauxv.go
(241 B)
๐
os_freebsd_riscv64.go
(198 B)
๐
os_illumos.go
(3.93 KB)
๐
os_js.go
(767 B)
๐
os_linux.go
(25.71 KB)
๐
os_linux_arm.go
(1.51 KB)
๐
os_linux_arm64.go
(478 B)
๐
os_linux_be64.go
(806 B)
๐
os_linux_generic.go
(870 B)
๐
os_linux_loong64.go
(263 B)
๐
os_linux_mips64x.go
(996 B)
๐
os_linux_mipsx.go
(987 B)
๐
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
(825 B)
๐
os_linux_x86.go
(234 B)
๐
os_netbsd.go
(10.12 KB)
๐
os_netbsd_386.go
(617 B)
๐
os_netbsd_amd64.go
(614 B)
๐
os_netbsd_arm.go
(1.07 KB)
๐
os_netbsd_arm64.go
(769 B)
๐
os_nonopenbsd.go
(437 B)
๐
os_only_solaris.go
(357 B)
๐
os_openbsd.go
(6.23 KB)
๐
os_openbsd_arm.go
(662 B)
๐
os_openbsd_arm64.go
(329 B)
๐
os_openbsd_libc.go
(1.49 KB)
๐
os_openbsd_mips64.go
(329 B)
๐
os_openbsd_syscall.go
(1.36 KB)
๐
os_openbsd_syscall1.go
(441 B)
๐
os_openbsd_syscall2.go
(2.51 KB)
๐
os_plan9.go
(10.18 KB)
๐
os_plan9_arm.go
(375 B)
๐
os_solaris.go
(6.62 KB)
๐
os_unix.go
(436 B)
๐
os_unix_nonlinux.go
(374 B)
๐
os_wasip1.go
(7 KB)
๐
os_wasm.go
(3.15 KB)
๐
os_windows.go
(41.39 KB)
๐
os_windows_arm.go
(511 B)
๐
os_windows_arm64.go
(339 B)
๐
pagetrace_off.go
(550 B)
๐
pagetrace_on.go
(10.36 KB)
๐
panic.go
(41.85 KB)
๐
panic32.go
(4.8 KB)
๐
panic_test.go
(1.71 KB)
๐
panicnil_test.go
(1.25 KB)
๐
pinner.go
(10.98 KB)
๐
pinner_test.go
(11.04 KB)
๐
plugin.go
(4.37 KB)
๐
pprof
๐
preempt.go
(15.03 KB)
๐
preempt_386.s
(824 B)
๐
preempt_amd64.s
(1.67 KB)
๐
preempt_arm.s
(1.49 KB)
๐
preempt_arm64.s
(1.97 KB)
๐
preempt_loong64.s
(2.41 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.92 KB)
๐
proc.go
(204.28 KB)
๐
proc_runtime_test.go
(1.38 KB)
๐
proc_test.go
(25.85 KB)
๐
profbuf.go
(18.26 KB)
๐
profbuf_test.go
(8.54 KB)
๐
proflabel.go
(1.52 KB)
๐
race
๐
race.go
(18.81 KB)
๐
race0.go
(2.79 KB)
๐
race_amd64.s
(13.94 KB)
๐
race_arm64.s
(14.21 KB)
๐
race_ppc64le.s
(15.93 KB)
๐
race_s390x.s
(11.99 KB)
๐
rand.go
(7.11 KB)
๐
rand_test.go
(1.95 KB)
๐
rdebug.go
(550 B)
๐
retry.go
(760 B)
๐
rt0_aix_ppc64.s
(4.09 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_freebsd_riscv64.s
(2.72 KB)
๐
rt0_illumos_amd64.s
(311 B)
๐
rt0_ios_amd64.s
(425 B)
๐
rt0_ios_arm64.s
(425 B)
๐
rt0_js_wasm.s
(1.53 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
(2.01 KB)
๐
rt0_linux_mips64x.s
(1014 B)
๐
rt0_linux_mipsx.s
(797 B)
๐
rt0_linux_ppc64.s
(847 B)
๐
rt0_linux_ppc64le.s
(2.89 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_openbsd_ppc64.s
(370 B)
๐
rt0_openbsd_riscv64.s
(372 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_wasip1_wasm.s
(387 B)
๐
rt0_windows_386.s
(1.28 KB)
๐
rt0_windows_amd64.s
(1.14 KB)
๐
rt0_windows_arm.s
(386 B)
๐
rt0_windows_arm64.s
(733 B)
๐
runtime-gdb.py
(15.44 KB)
๐
runtime-gdb_test.go
(24.04 KB)
๐
runtime-gdb_unix_test.go
(9.4 KB)
๐
runtime-lldb_test.go
(4.95 KB)
๐
runtime-seh_windows_test.go
(4.7 KB)
๐
runtime.go
(7.1 KB)
๐
runtime1.go
(16.66 KB)
๐
runtime2.go
(46.16 KB)
๐
runtime_boring.go
(606 B)
๐
runtime_linux_test.go
(1.77 KB)
๐
runtime_mmap_test.go
(1.77 KB)
๐
runtime_test.go
(11.81 KB)
๐
runtime_unix_test.go
(1.22 KB)
๐
rwmutex.go
(5 KB)
๐
rwmutex_test.go
(4.21 KB)
๐
security_aix.go
(449 B)
๐
security_issetugid.go
(502 B)
๐
security_linux.go
(335 B)
๐
security_nonunix.go
(256 B)
๐
security_test.go
(4.09 KB)
๐
security_unix.go
(818 B)
๐
select.go
(14.82 KB)
๐
sema.go
(18.43 KB)
๐
sema_test.go
(4.21 KB)
๐
semasleep_test.go
(3.46 KB)
๐
sigaction.go
(489 B)
๐
signal_386.go
(1.72 KB)
๐
signal_aix_ppc64.go
(3.54 KB)
๐
signal_amd64.go
(2.73 KB)
๐
signal_arm.go
(2.54 KB)
๐
signal_arm64.go
(3.83 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.24 KB)
๐
signal_freebsd_riscv64.go
(3.08 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.5 KB)
๐
signal_linux_riscv64.go
(2.92 KB)
๐
signal_linux_s390x.go
(4.49 KB)
๐
signal_loong64.go
(3.01 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.39 KB)
๐
signal_openbsd_mips64.go
(3.28 KB)
๐
signal_openbsd_ppc64.go
(3.53 KB)
๐
signal_openbsd_riscv64.go
(3.12 KB)
๐
signal_plan9.go
(1.93 KB)
๐
signal_ppc64x.go
(3.71 KB)
๐
signal_riscv64.go
(2.91 KB)
๐
signal_solaris.go
(4.5 KB)
๐
signal_solaris_amd64.go
(2.47 KB)
๐
signal_unix.go
(44.11 KB)
๐
signal_windows.go
(14.48 KB)
๐
signal_windows_test.go
(8.98 KB)
๐
sigqueue.go
(7.62 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.17 KB)
๐
sizeof_test.go
(1003 B)
๐
slice.go
(11.23 KB)
๐
slice_test.go
(10.32 KB)
๐
softfloat64.go
(11.54 KB)
๐
softfloat64_test.go
(4.04 KB)
๐
stack.go
(40.02 KB)
๐
stack_test.go
(23.14 KB)
๐
start_line_amd64_test.go
(647 B)
๐
start_line_test.go
(2.58 KB)
๐
stkframe.go
(9.88 KB)
๐
string.go
(13.35 KB)
๐
string_test.go
(13.33 KB)
๐
stubs.go
(17.39 KB)
๐
stubs2.go
(1.15 KB)
๐
stubs3.go
(324 B)
๐
stubs_386.go
(708 B)
๐
stubs_amd64.go
(1.38 KB)
๐
stubs_arm.go
(689 B)
๐
stubs_arm64.go
(700 B)
๐
stubs_linux.go
(650 B)
๐
stubs_loong64.go
(638 B)
๐
stubs_mips64x.go
(522 B)
๐
stubs_mipsx.go
(441 B)
๐
stubs_nonlinux.go
(298 B)
๐
stubs_ppc64.go
(302 B)
๐
stubs_ppc64x.go
(688 B)
๐
stubs_riscv64.go
(695 B)
๐
stubs_s390x.go
(414 B)
๐
symtab.go
(34.76 KB)
๐
symtab_test.go
(7.48 KB)
๐
symtabinl.go
(3.81 KB)
๐
symtabinl_test.go
(2.97 KB)
๐
sys_aix_ppc64.s
(7.42 KB)
๐
sys_arm.go
(521 B)
๐
sys_arm64.go
(469 B)
๐
sys_darwin.go
(22.56 KB)
๐
sys_darwin_amd64.s
(19.65 KB)
๐
sys_darwin_arm64.go
(1.74 KB)
๐
sys_darwin_arm64.s
(18.28 KB)
๐
sys_dragonfly_amd64.s
(8.31 KB)
๐
sys_freebsd_386.s
(9.41 KB)
๐
sys_freebsd_amd64.s
(12.67 KB)
๐
sys_freebsd_arm.s
(10.38 KB)
๐
sys_freebsd_arm64.s
(9.49 KB)
๐
sys_freebsd_riscv64.s
(8.92 KB)
๐
sys_libc.go
(1.84 KB)
๐
sys_linux_386.s
(17.89 KB)
๐
sys_linux_amd64.s
(15.74 KB)
๐
sys_linux_arm.s
(13.5 KB)
๐
sys_linux_arm64.s
(16.71 KB)
๐
sys_linux_loong64.s
(14.16 KB)
๐
sys_linux_mips64x.s
(11.96 KB)
๐
sys_linux_mipsx.s
(9.69 KB)
๐
sys_linux_ppc64x.s
(18.09 KB)
๐
sys_linux_riscv64.s
(11.48 KB)
๐
sys_linux_s390x.s
(12.49 KB)
๐
sys_loong64.go
(489 B)
๐
sys_mips64x.go
(500 B)
๐
sys_mipsx.go
(496 B)
๐
sys_netbsd_386.s
(9.61 KB)
๐
sys_netbsd_amd64.s
(9.78 KB)
๐
sys_netbsd_arm.s
(10.58 KB)
๐
sys_netbsd_arm64.s
(9.47 KB)
๐
sys_nonppc64x.go
(245 B)
๐
sys_openbsd.go
(2.59 KB)
๐
sys_openbsd1.go
(1.23 KB)
๐
sys_openbsd2.go
(8.67 KB)
๐
sys_openbsd3.go
(3.37 KB)
๐
sys_openbsd_386.s
(20.4 KB)
๐
sys_openbsd_amd64.s
(15.54 KB)
๐
sys_openbsd_arm.s
(18.46 KB)
๐
sys_openbsd_arm64.s
(15.05 KB)
๐
sys_openbsd_mips64.s
(8.81 KB)
๐
sys_openbsd_ppc64.s
(15.3 KB)
๐
sys_openbsd_riscv64.s
(16.8 KB)
๐
sys_plan9_386.s
(4.48 KB)
๐
sys_plan9_amd64.s
(4.56 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
(758 B)
๐
sys_wasm.s
(1.43 KB)
๐
sys_windows_386.s
(6.46 KB)
๐
sys_windows_amd64.s
(8.41 KB)
๐
sys_windows_arm.s
(7.72 KB)
๐
sys_windows_arm64.s
(6.8 KB)
๐
sys_x86.go
(552 B)
๐
syscall2_solaris.go
(1.85 KB)
๐
syscall_aix.go
(6.33 KB)
๐
syscall_solaris.go
(8.38 KB)
๐
syscall_unix_test.go
(635 B)
๐
syscall_windows.go
(16.57 KB)
๐
syscall_windows_test.go
(32.45 KB)
๐
tagptr.go
(496 B)
๐
tagptr_32bit.go
(927 B)
๐
tagptr_64bit.go
(3.23 KB)
๐
test_amd64.go
(196 B)
๐
test_amd64.s
(316 B)
๐
test_stubs.go
(218 B)
๐
testdata
๐
textflag.h
(1.47 KB)
๐
time.go
(30.57 KB)
๐
time_fake.go
(2.5 KB)
๐
time_linux_amd64.s
(2.02 KB)
๐
time_nofake.go
(709 B)
๐
time_test.go
(2.04 KB)
๐
time_windows.h
(753 B)
๐
time_windows_386.s
(1.71 KB)
๐
time_windows_amd64.s
(786 B)
๐
time_windows_arm.s
(1.97 KB)
๐
time_windows_arm64.s
(906 B)
๐
timeasm.go
(418 B)
๐
timestub.go
(532 B)
๐
timestub2.go
(363 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
(710 B)
๐
tls_ppc64x.s
(1.52 KB)
๐
tls_riscv64.s
(615 B)
๐
tls_s390x.s
(1.55 KB)
๐
tls_stub.go
(260 B)
๐
tls_windows_amd64.go
(294 B)
๐
trace
๐
trace.go
(62.76 KB)
๐
trace2.go
(33.81 KB)
๐
trace2buf.go
(6.58 KB)
๐
trace2cpu.go
(8.87 KB)
๐
trace2event.go
(8.39 KB)
๐
trace2map.go
(4.36 KB)
๐
trace2region.go
(1.68 KB)
๐
trace2runtime.go
(24.2 KB)
๐
trace2stack.go
(9.45 KB)
๐
trace2status.go
(7.24 KB)
๐
trace2string.go
(2.59 KB)
๐
trace2time.go
(3.21 KB)
๐
trace_cgo_test.go
(4.47 KB)
๐
traceback.go
(54.61 KB)
๐
traceback_test.go
(22.95 KB)
๐
tracebackx_test.go
(509 B)
๐
type.go
(12.1 KB)
๐
typekind.go
(743 B)
๐
unsafe.go
(2.97 KB)
๐
unsafepoint_test.go
(3.27 KB)
๐
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
(454 B)
๐
vdso_freebsd_riscv64.go
(429 B)
๐
vdso_freebsd_x86.go
(1.86 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
(659 B)
๐
vdso_test.go
(3.71 KB)
๐
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.06 KB)
๐
zcallback_windows_arm.s
(89.32 KB)
๐
zcallback_windows_arm64.s
(89.32 KB)
Editing: mranges.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. // Address range data structure. // // This file contains an implementation of a data structure which // manages ordered address ranges. package runtime import ( "internal/goarch" "runtime/internal/atomic" "unsafe" ) // addrRange represents a region of address space. // // An addrRange must never span a gap in the address space. type addrRange struct { // base and limit together represent the region of address space // [base, limit). That is, base is inclusive, limit is exclusive. // These are address over an offset view of the address space on // platforms with a segmented address space, that is, on platforms // where arenaBaseOffset != 0. base, limit offAddr } // makeAddrRange creates a new address range from two virtual addresses. // // Throws if the base and limit are not in the same memory segment. func makeAddrRange(base, limit uintptr) addrRange { r := addrRange{offAddr{base}, offAddr{limit}} if (base-arenaBaseOffset >= base) != (limit-arenaBaseOffset >= limit) { throw("addr range base and limit are not in the same memory segment") } return r } // size returns the size of the range represented in bytes. func (a addrRange) size() uintptr { if !a.base.lessThan(a.limit) { return 0 } // Subtraction is safe because limit and base must be in the same // segment of the address space. return a.limit.diff(a.base) } // contains returns whether or not the range contains a given address. func (a addrRange) contains(addr uintptr) bool { return a.base.lessEqual(offAddr{addr}) && (offAddr{addr}).lessThan(a.limit) } // subtract takes the addrRange toPrune and cuts out any overlap with // from, then returns the new range. subtract assumes that a and b // either don't overlap at all, only overlap on one side, or are equal. // If b is strictly contained in a, thus forcing a split, it will throw. func (a addrRange) subtract(b addrRange) addrRange { if b.base.lessEqual(a.base) && a.limit.lessEqual(b.limit) { return addrRange{} } else if a.base.lessThan(b.base) && b.limit.lessThan(a.limit) { throw("bad prune") } else if b.limit.lessThan(a.limit) && a.base.lessThan(b.limit) { a.base = b.limit } else if a.base.lessThan(b.base) && b.base.lessThan(a.limit) { a.limit = b.base } return a } // takeFromFront takes len bytes from the front of the address range, aligning // the base to align first. On success, returns the aligned start of the region // taken and true. func (a *addrRange) takeFromFront(len uintptr, align uint8) (uintptr, bool) { base := alignUp(a.base.addr(), uintptr(align)) + len if base > a.limit.addr() { return 0, false } a.base = offAddr{base} return base - len, true } // takeFromBack takes len bytes from the end of the address range, aligning // the limit to align after subtracting len. On success, returns the aligned // start of the region taken and true. func (a *addrRange) takeFromBack(len uintptr, align uint8) (uintptr, bool) { limit := alignDown(a.limit.addr()-len, uintptr(align)) if a.base.addr() > limit { return 0, false } a.limit = offAddr{limit} return limit, true } // removeGreaterEqual removes all addresses in a greater than or equal // to addr and returns the new range. func (a addrRange) removeGreaterEqual(addr uintptr) addrRange { if (offAddr{addr}).lessEqual(a.base) { return addrRange{} } if a.limit.lessEqual(offAddr{addr}) { return a } return makeAddrRange(a.base.addr(), addr) } var ( // minOffAddr is the minimum address in the offset space, and // it corresponds to the virtual address arenaBaseOffset. minOffAddr = offAddr{arenaBaseOffset} // maxOffAddr is the maximum address in the offset address // space. It corresponds to the highest virtual address representable // by the page alloc chunk and heap arena maps. maxOffAddr = offAddr{(((1 << heapAddrBits) - 1) + arenaBaseOffset) & uintptrMask} ) // offAddr represents an address in a contiguous view // of the address space on systems where the address space is // segmented. On other systems, it's just a normal address. type offAddr struct { // a is just the virtual address, but should never be used // directly. Call addr() to get this value instead. a uintptr } // add adds a uintptr offset to the offAddr. func (l offAddr) add(bytes uintptr) offAddr { return offAddr{a: l.a + bytes} } // sub subtracts a uintptr offset from the offAddr. func (l offAddr) sub(bytes uintptr) offAddr { return offAddr{a: l.a - bytes} } // diff returns the amount of bytes in between the // two offAddrs. func (l1 offAddr) diff(l2 offAddr) uintptr { return l1.a - l2.a } // lessThan returns true if l1 is less than l2 in the offset // address space. func (l1 offAddr) lessThan(l2 offAddr) bool { return (l1.a - arenaBaseOffset) < (l2.a - arenaBaseOffset) } // lessEqual returns true if l1 is less than or equal to l2 in // the offset address space. func (l1 offAddr) lessEqual(l2 offAddr) bool { return (l1.a - arenaBaseOffset) <= (l2.a - arenaBaseOffset) } // equal returns true if the two offAddr values are equal. func (l1 offAddr) equal(l2 offAddr) bool { // No need to compare in the offset space, it // means the same thing. return l1 == l2 } // addr returns the virtual address for this offset address. func (l offAddr) addr() uintptr { return l.a } // atomicOffAddr is like offAddr, but operations on it are atomic. // It also contains operations to be able to store marked addresses // to ensure that they're not overridden until they've been seen. type atomicOffAddr struct { // a contains the offset address, unlike offAddr. a atomic.Int64 } // Clear attempts to store minOffAddr in atomicOffAddr. It may fail // if a marked value is placed in the box in the meanwhile. func (b *atomicOffAddr) Clear() { for { old := b.a.Load() if old < 0 { return } if b.a.CompareAndSwap(old, int64(minOffAddr.addr()-arenaBaseOffset)) { return } } } // StoreMin stores addr if it's less than the current value in the // offset address space if the current value is not marked. func (b *atomicOffAddr) StoreMin(addr uintptr) { new := int64(addr - arenaBaseOffset) for { old := b.a.Load() if old < new { return } if b.a.CompareAndSwap(old, new) { return } } } // StoreUnmark attempts to unmark the value in atomicOffAddr and // replace it with newAddr. markedAddr must be a marked address // returned by Load. This function will not store newAddr if the // box no longer contains markedAddr. func (b *atomicOffAddr) StoreUnmark(markedAddr, newAddr uintptr) { b.a.CompareAndSwap(-int64(markedAddr-arenaBaseOffset), int64(newAddr-arenaBaseOffset)) } // StoreMarked stores addr but first converted to the offset address // space and then negated. func (b *atomicOffAddr) StoreMarked(addr uintptr) { b.a.Store(-int64(addr - arenaBaseOffset)) } // Load returns the address in the box as a virtual address. It also // returns if the value was marked or not. func (b *atomicOffAddr) Load() (uintptr, bool) { v := b.a.Load() wasMarked := false if v < 0 { wasMarked = true v = -v } return uintptr(v) + arenaBaseOffset, wasMarked } // addrRanges is a data structure holding a collection of ranges of // address space. // // The ranges are coalesced eagerly to reduce the // number ranges it holds. // // The slice backing store for this field is persistentalloc'd // and thus there is no way to free it. // // addrRanges is not thread-safe. type addrRanges struct { // ranges is a slice of ranges sorted by base. ranges []addrRange // totalBytes is the total amount of address space in bytes counted by // this addrRanges. totalBytes uintptr // sysStat is the stat to track allocations by this type sysStat *sysMemStat } func (a *addrRanges) init(sysStat *sysMemStat) { ranges := (*notInHeapSlice)(unsafe.Pointer(&a.ranges)) ranges.len = 0 ranges.cap = 16 ranges.array = (*notInHeap)(persistentalloc(unsafe.Sizeof(addrRange{})*uintptr(ranges.cap), goarch.PtrSize, sysStat)) a.sysStat = sysStat a.totalBytes = 0 } // findSucc returns the first index in a such that addr is // less than the base of the addrRange at that index. func (a *addrRanges) findSucc(addr uintptr) int { base := offAddr{addr} // Narrow down the search space via a binary search // for large addrRanges until we have at most iterMax // candidates left. const iterMax = 8 bot, top := 0, len(a.ranges) for top-bot > iterMax { i := int(uint(bot+top) >> 1) if a.ranges[i].contains(base.addr()) { // a.ranges[i] contains base, so // its successor is the next index. return i + 1 } if base.lessThan(a.ranges[i].base) { // In this case i might actually be // the successor, but we can't be sure // until we check the ones before it. top = i } else { // In this case we know base is // greater than or equal to a.ranges[i].limit-1, // so i is definitely not the successor. // We already checked i, so pick the next // one. bot = i + 1 } } // There are top-bot candidates left, so // iterate over them and find the first that // base is strictly less than. for i := bot; i < top; i++ { if base.lessThan(a.ranges[i].base) { return i } } return top } // findAddrGreaterEqual returns the smallest address represented by a // that is >= addr. Thus, if the address is represented by a, // then it returns addr. The second return value indicates whether // such an address exists for addr in a. That is, if addr is larger than // any address known to a, the second return value will be false. func (a *addrRanges) findAddrGreaterEqual(addr uintptr) (uintptr, bool) { i := a.findSucc(addr) if i == 0 { return a.ranges[0].base.addr(), true } if a.ranges[i-1].contains(addr) { return addr, true } if i < len(a.ranges) { return a.ranges[i].base.addr(), true } return 0, false } // contains returns true if a covers the address addr. func (a *addrRanges) contains(addr uintptr) bool { i := a.findSucc(addr) if i == 0 { return false } return a.ranges[i-1].contains(addr) } // add inserts a new address range to a. // // r must not overlap with any address range in a and r.size() must be > 0. func (a *addrRanges) add(r addrRange) { // The copies in this function are potentially expensive, but this data // structure is meant to represent the Go heap. At worst, copying this // would take ~160ยตs assuming a conservative copying rate of 25 GiB/s (the // copy will almost never trigger a page fault) for a 1 TiB heap with 4 MiB // arenas which is completely discontiguous. ~160ยตs is still a lot, but in // practice most platforms have 64 MiB arenas (which cuts this by a factor // of 16) and Go heaps are usually mostly contiguous, so the chance that // an addrRanges even grows to that size is extremely low. // An empty range has no effect on the set of addresses represented // by a, but passing a zero-sized range is almost always a bug. if r.size() == 0 { print("runtime: range = {", hex(r.base.addr()), ", ", hex(r.limit.addr()), "}\n") throw("attempted to add zero-sized address range") } // Because we assume r is not currently represented in a, // findSucc gives us our insertion index. i := a.findSucc(r.base.addr()) coalescesDown := i > 0 && a.ranges[i-1].limit.equal(r.base) coalescesUp := i < len(a.ranges) && r.limit.equal(a.ranges[i].base) if coalescesUp && coalescesDown { // We have neighbors and they both border us. // Merge a.ranges[i-1], r, and a.ranges[i] together into a.ranges[i-1]. a.ranges[i-1].limit = a.ranges[i].limit // Delete a.ranges[i]. copy(a.ranges[i:], a.ranges[i+1:]) a.ranges = a.ranges[:len(a.ranges)-1] } else if coalescesDown { // We have a neighbor at a lower address only and it borders us. // Merge the new space into a.ranges[i-1]. a.ranges[i-1].limit = r.limit } else if coalescesUp { // We have a neighbor at a higher address only and it borders us. // Merge the new space into a.ranges[i]. a.ranges[i].base = r.base } else { // We may or may not have neighbors which don't border us. // Add the new range. if len(a.ranges)+1 > cap(a.ranges) { // Grow the array. Note that this leaks the old array, but since // we're doubling we have at most 2x waste. For a 1 TiB heap and // 4 MiB arenas which are all discontiguous (both very conservative // assumptions), this would waste at most 4 MiB of memory. oldRanges := a.ranges ranges := (*notInHeapSlice)(unsafe.Pointer(&a.ranges)) ranges.len = len(oldRanges) + 1 ranges.cap = cap(oldRanges) * 2 ranges.array = (*notInHeap)(persistentalloc(unsafe.Sizeof(addrRange{})*uintptr(ranges.cap), goarch.PtrSize, a.sysStat)) // Copy in the old array, but make space for the new range. copy(a.ranges[:i], oldRanges[:i]) copy(a.ranges[i+1:], oldRanges[i:]) } else { a.ranges = a.ranges[:len(a.ranges)+1] copy(a.ranges[i+1:], a.ranges[i:]) } a.ranges[i] = r } a.totalBytes += r.size() } // removeLast removes and returns the highest-addressed contiguous range // of a, or the last nBytes of that range, whichever is smaller. If a is // empty, it returns an empty range. func (a *addrRanges) removeLast(nBytes uintptr) addrRange { if len(a.ranges) == 0 { return addrRange{} } r := a.ranges[len(a.ranges)-1] size := r.size() if size > nBytes { newEnd := r.limit.sub(nBytes) a.ranges[len(a.ranges)-1].limit = newEnd a.totalBytes -= nBytes return addrRange{newEnd, r.limit} } a.ranges = a.ranges[:len(a.ranges)-1] a.totalBytes -= size return r } // removeGreaterEqual removes the ranges of a which are above addr, and additionally // splits any range containing addr. func (a *addrRanges) removeGreaterEqual(addr uintptr) { pivot := a.findSucc(addr) if pivot == 0 { // addr is before all ranges in a. a.totalBytes = 0 a.ranges = a.ranges[:0] return } removed := uintptr(0) for _, r := range a.ranges[pivot:] { removed += r.size() } if r := a.ranges[pivot-1]; r.contains(addr) { removed += r.size() r = r.removeGreaterEqual(addr) if r.size() == 0 { pivot-- } else { removed -= r.size() a.ranges[pivot-1] = r } } a.ranges = a.ranges[:pivot] a.totalBytes -= removed } // cloneInto makes a deep clone of a's state into b, re-using // b's ranges if able. func (a *addrRanges) cloneInto(b *addrRanges) { if len(a.ranges) > cap(b.ranges) { // Grow the array. ranges := (*notInHeapSlice)(unsafe.Pointer(&b.ranges)) ranges.len = 0 ranges.cap = cap(a.ranges) ranges.array = (*notInHeap)(persistentalloc(unsafe.Sizeof(addrRange{})*uintptr(ranges.cap), goarch.PtrSize, b.sysStat)) } b.ranges = b.ranges[:len(a.ranges)] b.totalBytes = a.totalBytes copy(b.ranges, a.ranges) }
Upload File
Create Folder