Home avatar

欢迎大家

Linux Shebang

学习CTF时遇到一个git-dumper的题目,发现git-dumper是一个python脚本,但竟然可以直接运行,后来才知道是因为git-dumper的第一行是Shebang: #!/usr/bin/python3

Go sync.Pool 源码解读

使用方法

源码实现

Pool

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
type Pool struct {
	noCopy noCopy

	local     unsafe.Pointer // local fixed-size per-P pool, actual type is [P]poolLocal
	localSize uintptr        // size of the local array

	victim     unsafe.Pointer // local from previous cycle
	victimSize uintptr        // size of victims array

	// New optionally specifies a function to generate
	// a value when Get would otherwise return nil.
	// It may not be changed concurrently with calls to Get.
	New func() any
}