runtime.Defer: remove proc

This commit is contained in:
xushiwei
2024-06-08 16:31:52 +08:00
parent abf461a049
commit 32bfb3d57e
5 changed files with 81 additions and 90 deletions

View File

@@ -107,6 +107,11 @@ func SmartDoFile(inFile string, pkgPath ...string) {
}
outFile := dir + fname
b, err := os.ReadFile(outFile)
if err == nil && len(b) == 1 && b[0] == ';' {
return // skip to gen
}
if len(pkgPath) > 0 {
Do(pkgPath[0], inFile, outFile)
} else {

View File

@@ -18,17 +18,7 @@ package runtime
// Defer presents defer statements in a function.
type Defer struct {
proc func(uintptr)
bits uintptr
link *Defer
rund int // index of RunDefers
}
// DeferProc calls deferred statements.
func DeferProc(d *Defer) {
for d != nil {
d.proc(d.bits)
d = d.link
_ = d.rund
}
Bits uintptr
Link *Defer
Rund int // index of RunDefers
}