diff --git a/src/runtime/_mkmalloc/mkmalloc.go b/src/runtime/_mkmalloc/mkmalloc.go
index 8032983..46c50d6 100644
--- a/src/runtime/_mkmalloc/mkmalloc.go
+++ b/src/runtime/_mkmalloc/mkmalloc.go
@@ -107,7 +107,6 @@
const (
inlineFunc = replacementKind(iota)
subBasicLit
- foldCondition
)
// op is a single inlining operation for the inliner. Any calls to the function
@@ -172,7 +171,7 @@
{subBasicLit, "elemsize_", str(elemsize)},
{subBasicLit, "sizeclass_", str(sc)},
{subBasicLit, "noscanint_", str(noscan)},
- {foldCondition, "isTiny_", str(false)},
+ {subBasicLit, "isTiny_", str(0)},
},
})
}
@@ -200,7 +199,7 @@
{subBasicLit, "sizeclass_", str(tinySizeClass)},
{subBasicLit, "size_", str(s)},
{subBasicLit, "noscanint_", str(noscan)},
- {foldCondition, "isTiny_", str(true)},
+ {subBasicLit, "isTiny_", str(1)},
},
})
}
@@ -218,7 +217,7 @@
{subBasicLit, "elemsize_", str(elemsize)},
{subBasicLit, "sizeclass_", str(sc)},
{subBasicLit, "noscanint_", str(noscan)},
- {foldCondition, "isTiny_", str(false)},
+ {subBasicLit, "isTiny_", str(0)},
},
})
}
@@ -278,17 +277,10 @@
// Apply each of the ops given by the specs
stamped := ast.Node(containingFuncCopy)
for _, repl := range spec.ops {
- switch repl.kind {
- case inlineFunc:
- if toDecl, ok := funcDecls[repl.to]; ok {
- stamped = inlineFunction(stamped, repl.from, toDecl)
- }
- case subBasicLit:
+ if toDecl, ok := funcDecls[repl.to]; ok {
+ stamped = inlineFunction(stamped, repl.from, toDecl)
+ } else {
stamped = substituteWithBasicLit(stamped, repl.from, repl.to)
- case foldCondition:
- stamped = foldIfCondition(stamped, repl.from, repl.to)
- default:
- log.Fatal("unknown op kind %v", repl.kind)
}
}
@@ -318,43 +310,6 @@
}, nil)
}
-// foldIfCondition looks for if statements with a single boolean variable from, or
-// the negation of from and either replaces it with its body or nothing,
-// depending on whether the to value is true or false.
-func foldIfCondition(node ast.Node, from, to string) ast.Node {
- var isTrue bool
- switch to {
- case "true":
- isTrue = true
- case "false":
- isTrue = false
- default:
- log.Fatalf("op 'to' expr %q is not true or false", to)
- }
- return astutil.Apply(node, func(cursor *astutil.Cursor) bool {
- var foldIfTrue bool
- ifexpr, ok := cursor.Node().(*ast.IfStmt)
- if !ok {
- return true
- }
- if isIdentWithName(ifexpr.Cond, from) {
- foldIfTrue = true
- } else if unaryexpr, ok := ifexpr.Cond.(*ast.UnaryExpr); ok && unaryexpr.Op == token.NOT && isIdentWithName(unaryexpr.X, from) {
- foldIfTrue = false
- } else {
- // not an if with from or !from.
- return true
- }
- if foldIfTrue == isTrue {
- for _, stmt := range ifexpr.Body.List {
- cursor.InsertBefore(stmt)
- }
- }
- cursor.Delete()
- return true
- }, nil)
-}
-
// inlineFunction recursively replaces calls to the function 'from' with the body of the function
// 'toDecl'. All calls to 'from' must appear in assignment statements.
// The replacement is very simple: it doesn't substitute the arguments for the parameters, so the
diff --git a/src/runtime/malloc_generated.go b/src/runtime/malloc_generated.go
index cf329d2..6864ca0 100644
--- a/src/runtime/malloc_generated.go
+++ b/src/runtime/malloc_generated.go
@@ -12,6 +12,12 @@
func mallocgcSmallScanNoHeaderSC1(size uintptr, typ *_type, needzero bool) unsafe.Pointer {
+ const isTiny = 0 ==
+ 1
+ gp := getg()
+ if goexperiment.RuntimeSecret && isTiny && gp.secret > 0 {
+ return mallocgcSmallNoScanSC2(size, typ, needzero)
+ }
if doubleCheckMalloc {
if gcphase == _GCmarktermination {
throw("mallocgc called with gcphase == _GCmarktermination")
@@ -153,7 +159,6 @@
gcStart(t)
}
}
- gp := getg()
if goexperiment.RuntimeSecret && gp.secret > 0 {
addSecret(x)
@@ -177,6 +182,12 @@
func mallocgcSmallScanNoHeaderSC2(size uintptr, typ *_type, needzero bool) unsafe.Pointer {
+ const isTiny = 0 ==
+ 1
+ gp := getg()
+ if goexperiment.RuntimeSecret && isTiny && gp.secret > 0 {
+ return mallocgcSmallNoScanSC2(size, typ, needzero)
+ }
if doubleCheckMalloc {
if gcphase == _GCmarktermination {
throw("mallocgc called with gcphase == _GCmarktermination")
@@ -318,7 +329,6 @@
gcStart(t)
}
}
- gp := getg()
if goexperiment.RuntimeSecret && gp.secret > 0 {
addSecret(x)
@@ -342,6 +352,12 @@
func mallocgcSmallScanNoHeaderSC3(size uintptr, typ *_type, needzero bool) unsafe.Pointer {
+ const isTiny = 0 ==
+ 1
+ gp := getg()
+ if goexperiment.RuntimeSecret && isTiny && gp.secret > 0 {
+ return mallocgcSmallNoScanSC2(size, typ, needzero)
+ }
if doubleCheckMalloc {
if gcphase == _GCmarktermination {
throw("mallocgc called with gcphase == _GCmarktermination")
@@ -483,7 +499,6 @@
gcStart(t)
}
}
- gp := getg()
if goexperiment.RuntimeSecret && gp.secret > 0 {
addSecret(x)
@@ -507,6 +522,12 @@
func mallocgcSmallScanNoHeaderSC4(size uintptr, typ *_type, needzero bool) unsafe.Pointer {
+ const isTiny = 0 ==
+ 1
+ gp := getg()
+ if goexperiment.RuntimeSecret && isTiny && gp.secret > 0 {
+ return mallocgcSmallNoScanSC2(size, typ, needzero)
+ }
if doubleCheckMalloc {
if gcphase == _GCmarktermination {
throw("mallocgc called with gcphase == _GCmarktermination")
@@ -648,7 +669,6 @@
gcStart(t)
}
}
- gp := getg()
if goexperiment.RuntimeSecret && gp.secret > 0 {
addSecret(x)
@@ -672,6 +692,12 @@
func mallocgcSmallScanNoHeaderSC5(size uintptr, typ *_type, needzero bool) unsafe.Pointer {
+ const isTiny = 0 ==
+ 1
+ gp := getg()
+ if goexperiment.RuntimeSecret && isTiny && gp.secret > 0 {
+ return mallocgcSmallNoScanSC2(size, typ, needzero)
+ }
if doubleCheckMalloc {
if gcphase == _GCmarktermination {
throw("mallocgc called with gcphase == _GCmarktermination")
@@ -813,7 +839,6 @@
gcStart(t)
}
}
- gp := getg()
if goexperiment.RuntimeSecret && gp.secret > 0 {
addSecret(x)
@@ -837,6 +862,12 @@
func mallocgcSmallScanNoHeaderSC6(size uintptr, typ *_type, needzero bool) unsafe.Pointer {
+ const isTiny = 0 ==
+ 1
+ gp := getg()
+ if goexperiment.RuntimeSecret && isTiny && gp.secret > 0 {
+ return mallocgcSmallNoScanSC2(size, typ, needzero)
+ }
if doubleCheckMalloc {
if gcphase == _GCmarktermination {
throw("mallocgc called with gcphase == _GCmarktermination")
@@ -978,7 +1009,6 @@
gcStart(t)
}
}
- gp := getg()
if goexperiment.RuntimeSecret && gp.secret > 0 {
addSecret(x)
@@ -1002,6 +1032,12 @@
func mallocgcSmallScanNoHeaderSC7(size uintptr, typ *_type, needzero bool) unsafe.Pointer {
+ const isTiny = 0 ==
+ 1
+ gp := getg()
+ if goexperiment.RuntimeSecret && isTiny && gp.secret > 0 {
+ return mallocgcSmallNoScanSC2(size, typ, needzero)
+ }
if doubleCheckMalloc {
if gcphase == _GCmarktermination {
throw("mallocgc called with gcphase == _GCmarktermination")
@@ -1143,7 +1179,6 @@
gcStart(t)
}
}
- gp := getg()
if goexperiment.RuntimeSecret && gp.secret > 0 {
addSecret(x)
@@ -1167,6 +1202,12 @@
func mallocgcSmallScanNoHeaderSC8(size uintptr, typ *_type, needzero bool) unsafe.Pointer {
+ const isTiny = 0 ==
+ 1
+ gp := getg()
+ if goexperiment.RuntimeSecret && isTiny && gp.secret > 0 {
+ return mallocgcSmallNoScanSC2(size, typ, needzero)
+ }
if doubleCheckMalloc {
if gcphase == _GCmarktermination {
throw("mallocgc called with gcphase == _GCmarktermination")
@@ -1308,7 +1349,6 @@
gcStart(t)
}
}
- gp := getg()
if goexperiment.RuntimeSecret && gp.secret > 0 {
addSecret(x)
@@ -1332,6 +1372,12 @@
func mallocgcSmallScanNoHeaderSC9(size uintptr, typ *_type, needzero bool) unsafe.Pointer {
+ const isTiny = 0 ==
+ 1
+ gp := getg()
+ if goexperiment.RuntimeSecret && isTiny && gp.secret > 0 {
+ return mallocgcSmallNoScanSC2(size, typ, needzero)
+ }
if doubleCheckMalloc {
if gcphase == _GCmarktermination {
throw("mallocgc called with gcphase == _GCmarktermination")
@@ -1473,7 +1519,6 @@
gcStart(t)
}
}
- gp := getg()
if goexperiment.RuntimeSecret && gp.secret > 0 {
addSecret(x)
@@ -1497,6 +1542,12 @@
func mallocgcSmallScanNoHeaderSC10(size uintptr, typ *_type, needzero bool) unsafe.Pointer {
+ const isTiny = 0 ==
+ 1
+ gp := getg()
+ if goexperiment.RuntimeSecret && isTiny && gp.secret > 0 {
+ return mallocgcSmallNoScanSC2(size, typ, needzero)
+ }
if doubleCheckMalloc {
if gcphase == _GCmarktermination {
throw("mallocgc called with gcphase == _GCmarktermination")
@@ -1638,7 +1689,6 @@
gcStart(t)
}
}
- gp := getg()
if goexperiment.RuntimeSecret && gp.secret > 0 {
addSecret(x)
@@ -1662,6 +1712,12 @@
func mallocgcSmallScanNoHeaderSC11(size uintptr, typ *_type, needzero bool) unsafe.Pointer {
+ const isTiny = 0 ==
+ 1
+ gp := getg()
+ if goexperiment.RuntimeSecret && isTiny && gp.secret > 0 {
+ return mallocgcSmallNoScanSC2(size, typ, needzero)
+ }
if doubleCheckMalloc {
if gcphase == _GCmarktermination {
throw("mallocgc called with gcphase == _GCmarktermination")
@@ -1803,7 +1859,6 @@
gcStart(t)
}
}
- gp := getg()
if goexperiment.RuntimeSecret && gp.secret > 0 {
addSecret(x)
@@ -1827,6 +1882,12 @@
func mallocgcSmallScanNoHeaderSC12(size uintptr, typ *_type, needzero bool) unsafe.Pointer {
+ const isTiny = 0 ==
+ 1
+ gp := getg()
+ if goexperiment.RuntimeSecret && isTiny && gp.secret > 0 {
+ return mallocgcSmallNoScanSC2(size, typ, needzero)
+ }
if doubleCheckMalloc {
if gcphase == _GCmarktermination {
throw("mallocgc called with gcphase == _GCmarktermination")
@@ -1968,7 +2029,6 @@
gcStart(t)
}
}
- gp := getg()
if goexperiment.RuntimeSecret && gp.secret > 0 {
addSecret(x)
@@ -1992,6 +2052,12 @@
func mallocgcSmallScanNoHeaderSC13(size uintptr, typ *_type, needzero bool) unsafe.Pointer {
+ const isTiny = 0 ==
+ 1
+ gp := getg()
+ if goexperiment.RuntimeSecret && isTiny && gp.secret > 0 {
+ return mallocgcSmallNoScanSC2(size, typ, needzero)
+ }
if doubleCheckMalloc {
if gcphase == _GCmarktermination {
throw("mallocgc called with gcphase == _GCmarktermination")
@@ -2133,7 +2199,6 @@
gcStart(t)
}
}
- gp := getg()
if goexperiment.RuntimeSecret && gp.secret > 0 {
addSecret(x)
@@ -2157,6 +2222,12 @@
func mallocgcSmallScanNoHeaderSC14(size uintptr, typ *_type, needzero bool) unsafe.Pointer {
+ const isTiny = 0 ==
+ 1
+ gp := getg()
+ if goexperiment.RuntimeSecret && isTiny && gp.secret > 0 {
+ return mallocgcSmallNoScanSC2(size, typ, needzero)
+ }
if doubleCheckMalloc {
if gcphase == _GCmarktermination {
throw("mallocgc called with gcphase == _GCmarktermination")
@@ -2298,7 +2369,6 @@
gcStart(t)
}
}
- gp := getg()
if goexperiment.RuntimeSecret && gp.secret > 0 {
addSecret(x)
@@ -2322,6 +2392,12 @@
func mallocgcSmallScanNoHeaderSC15(size uintptr, typ *_type, needzero bool) unsafe.Pointer {
+ const isTiny = 0 ==
+ 1
+ gp := getg()
+ if goexperiment.RuntimeSecret && isTiny && gp.secret > 0 {
+ return mallocgcSmallNoScanSC2(size, typ, needzero)
+ }
if doubleCheckMalloc {
if gcphase == _GCmarktermination {
throw("mallocgc called with gcphase == _GCmarktermination")
@@ -2463,7 +2539,6 @@
gcStart(t)
}
}
- gp := getg()
if goexperiment.RuntimeSecret && gp.secret > 0 {
addSecret(x)
@@ -2487,6 +2562,12 @@
func mallocgcSmallScanNoHeaderSC16(size uintptr, typ *_type, needzero bool) unsafe.Pointer {
+ const isTiny = 0 ==
+ 1
+ gp := getg()
+ if goexperiment.RuntimeSecret && isTiny && gp.secret > 0 {
+ return mallocgcSmallNoScanSC2(size, typ, needzero)
+ }
if doubleCheckMalloc {
if gcphase == _GCmarktermination {
throw("mallocgc called with gcphase == _GCmarktermination")
@@ -2628,7 +2709,6 @@
gcStart(t)
}
}
- gp := getg()
if goexperiment.RuntimeSecret && gp.secret > 0 {
addSecret(x)
@@ -2652,6 +2732,12 @@
func mallocgcSmallScanNoHeaderSC17(size uintptr, typ *_type, needzero bool) unsafe.Pointer {
+ const isTiny = 0 ==
+ 1
+ gp := getg()
+ if goexperiment.RuntimeSecret && isTiny && gp.secret > 0 {
+ return mallocgcSmallNoScanSC2(size, typ, needzero)
+ }
if doubleCheckMalloc {
if gcphase == _GCmarktermination {
throw("mallocgc called with gcphase == _GCmarktermination")
@@ -2793,7 +2879,6 @@
gcStart(t)
}
}
- gp := getg()
if goexperiment.RuntimeSecret && gp.secret > 0 {
addSecret(x)
@@ -2817,6 +2902,12 @@
func mallocgcSmallScanNoHeaderSC18(size uintptr, typ *_type, needzero bool) unsafe.Pointer {
+ const isTiny = 0 ==
+ 1
+ gp := getg()
+ if goexperiment.RuntimeSecret && isTiny && gp.secret > 0 {
+ return mallocgcSmallNoScanSC2(size, typ, needzero)
+ }
if doubleCheckMalloc {
if gcphase == _GCmarktermination {
throw("mallocgc called with gcphase == _GCmarktermination")
@@ -2958,7 +3049,6 @@
gcStart(t)
}
}
- gp := getg()
if goexperiment.RuntimeSecret && gp.secret > 0 {
addSecret(x)
@@ -2982,6 +3072,12 @@
func mallocgcSmallScanNoHeaderSC19(size uintptr, typ *_type, needzero bool) unsafe.Pointer {
+ const isTiny = 0 ==
+ 1
+ gp := getg()
+ if goexperiment.RuntimeSecret && isTiny && gp.secret > 0 {
+ return mallocgcSmallNoScanSC2(size, typ, needzero)
+ }
if doubleCheckMalloc {
if gcphase == _GCmarktermination {
throw("mallocgc called with gcphase == _GCmarktermination")
@@ -3123,7 +3219,6 @@
gcStart(t)
}
}
- gp := getg()
if goexperiment.RuntimeSecret && gp.secret > 0 {
addSecret(x)
@@ -3147,6 +3242,12 @@
func mallocgcSmallScanNoHeaderSC20(size uintptr, typ *_type, needzero bool) unsafe.Pointer {
+ const isTiny = 0 ==
+ 1
+ gp := getg()
+ if goexperiment.RuntimeSecret && isTiny && gp.secret > 0 {
+ return mallocgcSmallNoScanSC2(size, typ, needzero)
+ }
if doubleCheckMalloc {
if gcphase == _GCmarktermination {
throw("mallocgc called with gcphase == _GCmarktermination")
@@ -3288,7 +3389,6 @@
gcStart(t)
}
}
- gp := getg()
if goexperiment.RuntimeSecret && gp.secret > 0 {
addSecret(x)
@@ -3312,6 +3412,12 @@
func mallocgcSmallScanNoHeaderSC21(size uintptr, typ *_type, needzero bool) unsafe.Pointer {
+ const isTiny = 0 ==
+ 1
+ gp := getg()
+ if goexperiment.RuntimeSecret && isTiny && gp.secret > 0 {
+ return mallocgcSmallNoScanSC2(size, typ, needzero)
+ }
if doubleCheckMalloc {
if gcphase == _GCmarktermination {
throw("mallocgc called with gcphase == _GCmarktermination")
@@ -3453,7 +3559,6 @@
gcStart(t)
}
}
- gp := getg()
if goexperiment.RuntimeSecret && gp.secret > 0 {
addSecret(x)
@@ -3477,6 +3582,12 @@
func mallocgcSmallScanNoHeaderSC22(size uintptr, typ *_type, needzero bool) unsafe.Pointer {
+ const isTiny = 0 ==
+ 1
+ gp := getg()
+ if goexperiment.RuntimeSecret && isTiny && gp.secret > 0 {
+ return mallocgcSmallNoScanSC2(size, typ, needzero)
+ }
if doubleCheckMalloc {
if gcphase == _GCmarktermination {
throw("mallocgc called with gcphase == _GCmarktermination")
@@ -3618,7 +3729,6 @@
gcStart(t)
}
}
- gp := getg()
if goexperiment.RuntimeSecret && gp.secret > 0 {
addSecret(x)
@@ -3642,6 +3752,12 @@
func mallocgcSmallScanNoHeaderSC23(size uintptr, typ *_type, needzero bool) unsafe.Pointer {
+ const isTiny = 0 ==
+ 1
+ gp := getg()
+ if goexperiment.RuntimeSecret && isTiny && gp.secret > 0 {
+ return mallocgcSmallNoScanSC2(size, typ, needzero)
+ }
if doubleCheckMalloc {
if gcphase == _GCmarktermination {
throw("mallocgc called with gcphase == _GCmarktermination")
@@ -3783,7 +3899,6 @@
gcStart(t)
}
}
- gp := getg()
if goexperiment.RuntimeSecret && gp.secret > 0 {
addSecret(x)
@@ -3807,6 +3922,12 @@
func mallocgcSmallScanNoHeaderSC24(size uintptr, typ *_type, needzero bool) unsafe.Pointer {
+ const isTiny = 0 ==
+ 1
+ gp := getg()
+ if goexperiment.RuntimeSecret && isTiny && gp.secret > 0 {
+ return mallocgcSmallNoScanSC2(size, typ, needzero)
+ }
if doubleCheckMalloc {
if gcphase == _GCmarktermination {
throw("mallocgc called with gcphase == _GCmarktermination")
@@ -3948,7 +4069,6 @@
gcStart(t)
}
}
- gp := getg()
if goexperiment.RuntimeSecret && gp.secret > 0 {
addSecret(x)
@@ -3972,6 +4092,12 @@
func mallocgcSmallScanNoHeaderSC25(size uintptr, typ *_type, needzero bool) unsafe.Pointer {
+ const isTiny = 0 ==
+ 1
+ gp := getg()
+ if goexperiment.RuntimeSecret && isTiny && gp.secret > 0 {
+ return mallocgcSmallNoScanSC2(size, typ, needzero)
+ }
if doubleCheckMalloc {
if gcphase == _GCmarktermination {
throw("mallocgc called with gcphase == _GCmarktermination")
@@ -4113,7 +4239,6 @@
gcStart(t)
}
}
- gp := getg()
if goexperiment.RuntimeSecret && gp.secret > 0 {
addSecret(x)
@@ -4137,6 +4262,12 @@
func mallocgcSmallScanNoHeaderSC26(size uintptr, typ *_type, needzero bool) unsafe.Pointer {
+ const isTiny = 0 ==
+ 1
+ gp := getg()
+ if goexperiment.RuntimeSecret && isTiny && gp.secret > 0 {
+ return mallocgcSmallNoScanSC2(size, typ, needzero)
+ }
if doubleCheckMalloc {
if gcphase == _GCmarktermination {
throw("mallocgc called with gcphase == _GCmarktermination")
@@ -4278,7 +4409,6 @@
gcStart(t)
}
}
- gp := getg()
if goexperiment.RuntimeSecret && gp.secret > 0 {
addSecret(x)
@@ -4302,11 +4432,12 @@
func mallocTiny1(size uintptr, typ *_type, needzero bool) unsafe.Pointer {
+ const isTiny = 1 ==
+ 1
gp := getg()
- if goexperiment.RuntimeSecret && gp.secret > 0 {
+ if goexperiment.RuntimeSecret && isTiny && gp.secret > 0 {
return mallocgcSmallNoScanSC2(size, typ, needzero)
}
-
if doubleCheckMalloc {
if gcphase == _GCmarktermination {
throw("mallocgc called with gcphase == _GCmarktermination")
@@ -4358,6 +4489,11 @@
const elemsize = 0
{
+ if goexperiment.RuntimeSecret && gp.secret > 0 {
+
+ addSecret(x)
+ }
+
if valgrindenabled {
valgrindMalloc(x, size)
}
@@ -4440,6 +4576,11 @@
x = add(x, elemsize-constsize)
}
+ if goexperiment.RuntimeSecret && gp.secret > 0 {
+
+ addSecret(x)
+ }
+
if valgrindenabled {
valgrindMalloc(x, size)
}
@@ -4458,11 +4599,12 @@
func mallocTiny2(size uintptr, typ *_type, needzero bool) unsafe.Pointer {
+ const isTiny = 1 ==
+ 1
gp := getg()
- if goexperiment.RuntimeSecret && gp.secret > 0 {
+ if goexperiment.RuntimeSecret && isTiny && gp.secret > 0 {
return mallocgcSmallNoScanSC2(size, typ, needzero)
}
-
if doubleCheckMalloc {
if gcphase == _GCmarktermination {
throw("mallocgc called with gcphase == _GCmarktermination")
@@ -4514,6 +4656,11 @@
const elemsize = 0
{
+ if goexperiment.RuntimeSecret && gp.secret > 0 {
+
+ addSecret(x)
+ }
+
if valgrindenabled {
valgrindMalloc(x, size)
}
@@ -4596,6 +4743,11 @@
x = add(x, elemsize-constsize)
}
+ if goexperiment.RuntimeSecret && gp.secret > 0 {
+
+ addSecret(x)
+ }
+
if valgrindenabled {
valgrindMalloc(x, size)
}
@@ -4614,11 +4766,12 @@
func mallocTiny3(size uintptr, typ *_type, needzero bool) unsafe.Pointer {
+ const isTiny = 1 ==
+ 1
gp := getg()
- if goexperiment.RuntimeSecret && gp.secret > 0 {
+ if goexperiment.RuntimeSecret && isTiny && gp.secret > 0 {
return mallocgcSmallNoScanSC2(size, typ, needzero)
}
-
if doubleCheckMalloc {
if gcphase == _GCmarktermination {
throw("mallocgc called with gcphase == _GCmarktermination")
@@ -4670,6 +4823,11 @@
const elemsize = 0
{
+ if goexperiment.RuntimeSecret && gp.secret > 0 {
+
+ addSecret(x)
+ }
+
if valgrindenabled {
valgrindMalloc(x, size)
}
@@ -4752,6 +4910,11 @@
x = add(x, elemsize-constsize)
}
+ if goexperiment.RuntimeSecret && gp.secret > 0 {
+
+ addSecret(x)
+ }
+
if valgrindenabled {
valgrindMalloc(x, size)
}
@@ -4770,11 +4933,12 @@
func mallocTiny4(size uintptr, typ *_type, needzero bool) unsafe.Pointer {
+ const isTiny = 1 ==
+ 1
gp := getg()
- if goexperiment.RuntimeSecret && gp.secret > 0 {
+ if goexperiment.RuntimeSecret && isTiny && gp.secret > 0 {
return mallocgcSmallNoScanSC2(size, typ, needzero)
}
-
if doubleCheckMalloc {
if gcphase == _GCmarktermination {
throw("mallocgc called with gcphase == _GCmarktermination")
@@ -4826,6 +4990,11 @@
const elemsize = 0
{
+ if goexperiment.RuntimeSecret && gp.secret > 0 {
+
+ addSecret(x)
+ }
+
if valgrindenabled {
valgrindMalloc(x, size)
}
@@ -4908,6 +5077,11 @@
x = add(x, elemsize-constsize)
}
+ if goexperiment.RuntimeSecret && gp.secret > 0 {
+
+ addSecret(x)
+ }
+
if valgrindenabled {
valgrindMalloc(x, size)
}
@@ -4926,11 +5100,12 @@
func mallocTiny5(size uintptr, typ *_type, needzero bool) unsafe.Pointer {
+ const isTiny = 1 ==
+ 1
gp := getg()
- if goexperiment.RuntimeSecret && gp.secret > 0 {
+ if goexperiment.RuntimeSecret && isTiny && gp.secret > 0 {
return mallocgcSmallNoScanSC2(size, typ, needzero)
}
-
if doubleCheckMalloc {
if gcphase == _GCmarktermination {
throw("mallocgc called with gcphase == _GCmarktermination")
@@ -4982,6 +5157,11 @@
const elemsize = 0
{
+ if goexperiment.RuntimeSecret && gp.secret > 0 {
+
+ addSecret(x)
+ }
+
if valgrindenabled {
valgrindMalloc(x, size)
}
@@ -5064,6 +5244,11 @@
x = add(x, elemsize-constsize)
}
+ if goexperiment.RuntimeSecret && gp.secret > 0 {
+
+ addSecret(x)
+ }
+
if valgrindenabled {
valgrindMalloc(x, size)
}
@@ -5082,11 +5267,12 @@
func mallocTiny6(size uintptr, typ *_type, needzero bool) unsafe.Pointer {
+ const isTiny = 1 ==
+ 1
gp := getg()
- if goexperiment.RuntimeSecret && gp.secret > 0 {
+ if goexperiment.RuntimeSecret && isTiny && gp.secret > 0 {
return mallocgcSmallNoScanSC2(size, typ, needzero)
}
-
if doubleCheckMalloc {
if gcphase == _GCmarktermination {
throw("mallocgc called with gcphase == _GCmarktermination")
@@ -5138,6 +5324,11 @@
const elemsize = 0
{
+ if goexperiment.RuntimeSecret && gp.secret > 0 {
+
+ addSecret(x)
+ }
+
if valgrindenabled {
valgrindMalloc(x, size)
}
@@ -5220,6 +5411,11 @@
x = add(x, elemsize-constsize)
}
+ if goexperiment.RuntimeSecret && gp.secret > 0 {
+
+ addSecret(x)
+ }
+
if valgrindenabled {
valgrindMalloc(x, size)
}
@@ -5238,11 +5434,12 @@
func mallocTiny7(size uintptr, typ *_type, needzero bool) unsafe.Pointer {
+ const isTiny = 1 ==
+ 1
gp := getg()
- if goexperiment.RuntimeSecret && gp.secret > 0 {
+ if goexperiment.RuntimeSecret && isTiny && gp.secret > 0 {
return mallocgcSmallNoScanSC2(size, typ, needzero)
}
-
if doubleCheckMalloc {
if gcphase == _GCmarktermination {
throw("mallocgc called with gcphase == _GCmarktermination")
@@ -5294,6 +5491,11 @@
const elemsize = 0
{
+ if goexperiment.RuntimeSecret && gp.secret > 0 {
+
+ addSecret(x)
+ }
+
if valgrindenabled {
valgrindMalloc(x, size)
}
@@ -5376,6 +5578,11 @@
x = add(x, elemsize-constsize)
}
+ if goexperiment.RuntimeSecret && gp.secret > 0 {
+
+ addSecret(x)
+ }
+
if valgrindenabled {
valgrindMalloc(x, size)
}
@@ -5394,11 +5601,12 @@
func mallocTiny8(size uintptr, typ *_type, needzero bool) unsafe.Pointer {
+ const isTiny = 1 ==
+ 1
gp := getg()
- if goexperiment.RuntimeSecret && gp.secret > 0 {
+ if goexperiment.RuntimeSecret && isTiny && gp.secret > 0 {
return mallocgcSmallNoScanSC2(size, typ, needzero)
}
-
if doubleCheckMalloc {
if gcphase == _GCmarktermination {
throw("mallocgc called with gcphase == _GCmarktermination")
@@ -5450,6 +5658,11 @@
const elemsize = 0
{
+ if goexperiment.RuntimeSecret && gp.secret > 0 {
+
+ addSecret(x)
+ }
+
if valgrindenabled {
valgrindMalloc(x, size)
}
@@ -5532,6 +5745,11 @@
x = add(x, elemsize-constsize)
}
+ if goexperiment.RuntimeSecret && gp.secret > 0 {
+
+ addSecret(x)
+ }
+
if valgrindenabled {
valgrindMalloc(x, size)
}
@@ -5550,11 +5768,12 @@
func mallocTiny9(size uintptr, typ *_type, needzero bool) unsafe.Pointer {
+ const isTiny = 1 ==
+ 1
gp := getg()
- if goexperiment.RuntimeSecret && gp.secret > 0 {
+ if goexperiment.RuntimeSecret && isTiny && gp.secret > 0 {
return mallocgcSmallNoScanSC2(size, typ, needzero)
}
-
if doubleCheckMalloc {
if gcphase == _GCmarktermination {
throw("mallocgc called with gcphase == _GCmarktermination")
@@ -5606,6 +5825,11 @@
const elemsize = 0
{
+ if goexperiment.RuntimeSecret && gp.secret > 0 {
+
+ addSecret(x)
+ }
+
if valgrindenabled {
valgrindMalloc(x, size)
}
@@ -5688,6 +5912,11 @@
x = add(x, elemsize-constsize)
}
+ if goexperiment.RuntimeSecret && gp.secret > 0 {
+
+ addSecret(x)
+ }
+
if valgrindenabled {
valgrindMalloc(x, size)
}
@@ -5706,11 +5935,12 @@
func mallocTiny10(size uintptr, typ *_type, needzero bool) unsafe.Pointer {
+ const isTiny = 1 ==
+ 1
gp := getg()
- if goexperiment.RuntimeSecret && gp.secret > 0 {
+ if goexperiment.RuntimeSecret && isTiny && gp.secret > 0 {
return mallocgcSmallNoScanSC2(size, typ, needzero)
}
-
if doubleCheckMalloc {
if gcphase == _GCmarktermination {
throw("mallocgc called with gcphase == _GCmarktermination")
@@ -5762,6 +5992,11 @@
const elemsize = 0
{
+ if goexperiment.RuntimeSecret && gp.secret > 0 {
+
+ addSecret(x)
+ }
+
if valgrindenabled {
valgrindMalloc(x, size)
}
@@ -5844,6 +6079,11 @@
x = add(x, elemsize-constsize)
}
+ if goexperiment.RuntimeSecret && gp.secret > 0 {
+
+ addSecret(x)
+ }
+
if valgrindenabled {
valgrindMalloc(x, size)
}
@@ -5862,11 +6102,12 @@
func mallocTiny11(size uintptr, typ *_type, needzero bool) unsafe.Pointer {
+ const isTiny = 1 ==
+ 1
gp := getg()
- if goexperiment.RuntimeSecret && gp.secret > 0 {
+ if goexperiment.RuntimeSecret && isTiny && gp.secret > 0 {
return mallocgcSmallNoScanSC2(size, typ, needzero)
}
-
if doubleCheckMalloc {
if gcphase == _GCmarktermination {
throw("mallocgc called with gcphase == _GCmarktermination")
@@ -5918,6 +6159,11 @@
const elemsize = 0
{
+ if goexperiment.RuntimeSecret && gp.secret > 0 {
+
+ addSecret(x)
+ }
+
if valgrindenabled {
valgrindMalloc(x, size)
}
@@ -6000,6 +6246,11 @@
x = add(x, elemsize-constsize)
}
+ if goexperiment.RuntimeSecret && gp.secret > 0 {
+
+ addSecret(x)
+ }
+
if valgrindenabled {
valgrindMalloc(x, size)
}
@@ -6018,11 +6269,12 @@
func mallocTiny12(size uintptr, typ *_type, needzero bool) unsafe.Pointer {
+ const isTiny = 1 ==
+ 1
gp := getg()
- if goexperiment.RuntimeSecret && gp.secret > 0 {
+ if goexperiment.RuntimeSecret && isTiny && gp.secret > 0 {
return mallocgcSmallNoScanSC2(size, typ, needzero)
}
-
if doubleCheckMalloc {
if gcphase == _GCmarktermination {
throw("mallocgc called with gcphase == _GCmarktermination")
@@ -6074,6 +6326,11 @@
const elemsize = 0
{
+ if goexperiment.RuntimeSecret && gp.secret > 0 {
+
+ addSecret(x)
+ }
+
if valgrindenabled {
valgrindMalloc(x, size)
}
@@ -6156,6 +6413,11 @@
x = add(x, elemsize-constsize)
}
+ if goexperiment.RuntimeSecret && gp.secret > 0 {
+
+ addSecret(x)
+ }
+
if valgrindenabled {
valgrindMalloc(x, size)
}
@@ -6174,11 +6436,12 @@
func mallocTiny13(size uintptr, typ *_type, needzero bool) unsafe.Pointer {
+ const isTiny = 1 ==
+ 1
gp := getg()
- if goexperiment.RuntimeSecret && gp.secret > 0 {
+ if goexperiment.RuntimeSecret && isTiny && gp.secret > 0 {
return mallocgcSmallNoScanSC2(size, typ, needzero)
}
-
if doubleCheckMalloc {
if gcphase == _GCmarktermination {
throw("mallocgc called with gcphase == _GCmarktermination")
@@ -6230,6 +6493,11 @@
const elemsize = 0
{
+ if goexperiment.RuntimeSecret && gp.secret > 0 {
+
+ addSecret(x)
+ }
+
if valgrindenabled {
valgrindMalloc(x, size)
}
@@ -6312,6 +6580,11 @@
x = add(x, elemsize-constsize)
}
+ if goexperiment.RuntimeSecret && gp.secret > 0 {
+
+ addSecret(x)
+ }
+
if valgrindenabled {
valgrindMalloc(x, size)
}
@@ -6330,11 +6603,12 @@
func mallocTiny14(size uintptr, typ *_type, needzero bool) unsafe.Pointer {
+ const isTiny = 1 ==
+ 1
gp := getg()
- if goexperiment.RuntimeSecret && gp.secret > 0 {
+ if goexperiment.RuntimeSecret && isTiny && gp.secret > 0 {
return mallocgcSmallNoScanSC2(size, typ, needzero)
}
-
if doubleCheckMalloc {
if gcphase == _GCmarktermination {
throw("mallocgc called with gcphase == _GCmarktermination")
@@ -6386,6 +6660,11 @@
const elemsize = 0
{
+ if goexperiment.RuntimeSecret && gp.secret > 0 {
+
+ addSecret(x)
+ }
+
if valgrindenabled {
valgrindMalloc(x, size)
}
@@ -6468,6 +6747,11 @@
x = add(x, elemsize-constsize)
}
+ if goexperiment.RuntimeSecret && gp.secret > 0 {
+
+ addSecret(x)
+ }
+
if valgrindenabled {
valgrindMalloc(x, size)
}
@@ -6486,11 +6770,12 @@
func mallocTiny15(size uintptr, typ *_type, needzero bool) unsafe.Pointer {
+ const isTiny = 1 ==
+ 1
gp := getg()
- if goexperiment.RuntimeSecret && gp.secret > 0 {
+ if goexperiment.RuntimeSecret && isTiny && gp.secret > 0 {
return mallocgcSmallNoScanSC2(size, typ, needzero)
}
-
if doubleCheckMalloc {
if gcphase == _GCmarktermination {
throw("mallocgc called with gcphase == _GCmarktermination")
@@ -6542,6 +6827,11 @@
const elemsize = 0
{
+ if goexperiment.RuntimeSecret && gp.secret > 0 {
+
+ addSecret(x)
+ }
+
if valgrindenabled {
valgrindMalloc(x, size)
}
@@ -6624,6 +6914,11 @@
x = add(x, elemsize-constsize)
}
+ if goexperiment.RuntimeSecret && gp.secret > 0 {
+
+ addSecret(x)
+ }
+
if valgrindenabled {
valgrindMalloc(x, size)
}
@@ -6642,6 +6937,12 @@
func mallocgcSmallNoScanSC2(size uintptr, typ *_type, needzero bool) unsafe.Pointer {
+ const isTiny = 0 ==
+ 1
+ gp := getg()
+ if goexperiment.RuntimeSecret && isTiny && gp.secret > 0 {
+ return mallocgcSmallNoScanSC2(size, typ, needzero)
+ }
if doubleCheckMalloc {
if gcphase == _GCmarktermination {
throw("mallocgc called with gcphase == _GCmarktermination")
@@ -6683,7 +6984,6 @@
x := v
{
- gp := getg()
if goexperiment.RuntimeSecret && gp.secret > 0 {
addSecret(x)
@@ -6754,7 +7054,6 @@
gcStart(t)
}
}
- gp := getg()
if goexperiment.RuntimeSecret && gp.secret > 0 {
addSecret(x)
@@ -6778,6 +7077,12 @@
func mallocgcSmallNoScanSC3(size uintptr, typ *_type, needzero bool) unsafe.Pointer {
+ const isTiny = 0 ==
+ 1
+ gp := getg()
+ if goexperiment.RuntimeSecret && isTiny && gp.secret > 0 {
+ return mallocgcSmallNoScanSC2(size, typ, needzero)
+ }
if doubleCheckMalloc {
if gcphase == _GCmarktermination {
throw("mallocgc called with gcphase == _GCmarktermination")
@@ -6819,7 +7124,6 @@
x := v
{
- gp := getg()
if goexperiment.RuntimeSecret && gp.secret > 0 {
addSecret(x)
@@ -6890,7 +7194,6 @@
gcStart(t)
}
}
- gp := getg()
if goexperiment.RuntimeSecret && gp.secret > 0 {
addSecret(x)
@@ -6914,6 +7217,12 @@
func mallocgcSmallNoScanSC4(size uintptr, typ *_type, needzero bool) unsafe.Pointer {
+ const isTiny = 0 ==
+ 1
+ gp := getg()
+ if goexperiment.RuntimeSecret && isTiny && gp.secret > 0 {
+ return mallocgcSmallNoScanSC2(size, typ, needzero)
+ }
if doubleCheckMalloc {
if gcphase == _GCmarktermination {
throw("mallocgc called with gcphase == _GCmarktermination")
@@ -6955,7 +7264,6 @@
x := v
{
- gp := getg()
if goexperiment.RuntimeSecret && gp.secret > 0 {
addSecret(x)
@@ -7026,7 +7334,6 @@
gcStart(t)
}
}
- gp := getg()
if goexperiment.RuntimeSecret && gp.secret > 0 {
addSecret(x)
@@ -7050,6 +7357,12 @@
func mallocgcSmallNoScanSC5(size uintptr, typ *_type, needzero bool) unsafe.Pointer {
+ const isTiny = 0 ==
+ 1
+ gp := getg()
+ if goexperiment.RuntimeSecret && isTiny && gp.secret > 0 {
+ return mallocgcSmallNoScanSC2(size, typ, needzero)
+ }
if doubleCheckMalloc {
if gcphase == _GCmarktermination {
throw("mallocgc called with gcphase == _GCmarktermination")
@@ -7091,7 +7404,6 @@
x := v
{
- gp := getg()
if goexperiment.RuntimeSecret && gp.secret > 0 {
addSecret(x)
@@ -7162,7 +7474,6 @@
gcStart(t)
}
}
- gp := getg()
if goexperiment.RuntimeSecret && gp.secret > 0 {
addSecret(x)
@@ -7186,6 +7497,12 @@
func mallocgcSmallNoScanSC6(size uintptr, typ *_type, needzero bool) unsafe.Pointer {
+ const isTiny = 0 ==
+ 1
+ gp := getg()
+ if goexperiment.RuntimeSecret && isTiny && gp.secret > 0 {
+ return mallocgcSmallNoScanSC2(size, typ, needzero)
+ }
if doubleCheckMalloc {
if gcphase == _GCmarktermination {
throw("mallocgc called with gcphase == _GCmarktermination")
@@ -7227,7 +7544,6 @@
x := v
{
- gp := getg()
if goexperiment.RuntimeSecret && gp.secret > 0 {
addSecret(x)
@@ -7298,7 +7614,6 @@
gcStart(t)
}
}
- gp := getg()
if goexperiment.RuntimeSecret && gp.secret > 0 {
addSecret(x)
@@ -7322,6 +7637,12 @@
func mallocgcSmallNoScanSC7(size uintptr, typ *_type, needzero bool) unsafe.Pointer {
+ const isTiny = 0 ==
+ 1
+ gp := getg()
+ if goexperiment.RuntimeSecret && isTiny && gp.secret > 0 {
+ return mallocgcSmallNoScanSC2(size, typ, needzero)
+ }
if doubleCheckMalloc {
if gcphase == _GCmarktermination {
throw("mallocgc called with gcphase == _GCmarktermination")
@@ -7363,7 +7684,6 @@
x := v
{
- gp := getg()
if goexperiment.RuntimeSecret && gp.secret > 0 {
addSecret(x)
@@ -7434,7 +7754,6 @@
gcStart(t)
}
}
- gp := getg()
if goexperiment.RuntimeSecret && gp.secret > 0 {
addSecret(x)
@@ -7458,6 +7777,12 @@
func mallocgcSmallNoScanSC8(size uintptr, typ *_type, needzero bool) unsafe.Pointer {
+ const isTiny = 0 ==
+ 1
+ gp := getg()
+ if goexperiment.RuntimeSecret && isTiny && gp.secret > 0 {
+ return mallocgcSmallNoScanSC2(size, typ, needzero)
+ }
if doubleCheckMalloc {
if gcphase == _GCmarktermination {
throw("mallocgc called with gcphase == _GCmarktermination")
@@ -7499,7 +7824,6 @@
x := v
{
- gp := getg()
if goexperiment.RuntimeSecret && gp.secret > 0 {
addSecret(x)
@@ -7570,7 +7894,6 @@
gcStart(t)
}
}
- gp := getg()
if goexperiment.RuntimeSecret && gp.secret > 0 {
addSecret(x)
@@ -7594,6 +7917,12 @@
func mallocgcSmallNoScanSC9(size uintptr, typ *_type, needzero bool) unsafe.Pointer {
+ const isTiny = 0 ==
+ 1
+ gp := getg()
+ if goexperiment.RuntimeSecret && isTiny && gp.secret > 0 {
+ return mallocgcSmallNoScanSC2(size, typ, needzero)
+ }
if doubleCheckMalloc {
if gcphase == _GCmarktermination {
throw("mallocgc called with gcphase == _GCmarktermination")
@@ -7635,7 +7964,6 @@
x := v
{
- gp := getg()
if goexperiment.RuntimeSecret && gp.secret > 0 {
addSecret(x)
@@ -7706,7 +8034,6 @@
gcStart(t)
}
}
- gp := getg()
if goexperiment.RuntimeSecret && gp.secret > 0 {
addSecret(x)
@@ -7730,6 +8057,12 @@
func mallocgcSmallNoScanSC10(size uintptr, typ *_type, needzero bool) unsafe.Pointer {
+ const isTiny = 0 ==
+ 1
+ gp := getg()
+ if goexperiment.RuntimeSecret && isTiny && gp.secret > 0 {
+ return mallocgcSmallNoScanSC2(size, typ, needzero)
+ }
if doubleCheckMalloc {
if gcphase == _GCmarktermination {
throw("mallocgc called with gcphase == _GCmarktermination")
@@ -7771,7 +8104,6 @@
x := v
{
- gp := getg()
if goexperiment.RuntimeSecret && gp.secret > 0 {
addSecret(x)
@@ -7842,7 +8174,6 @@
gcStart(t)
}
}
- gp := getg()
if goexperiment.RuntimeSecret && gp.secret > 0 {
addSecret(x)
@@ -7866,6 +8197,12 @@
func mallocgcSmallNoScanSC11(size uintptr, typ *_type, needzero bool) unsafe.Pointer {
+ const isTiny = 0 ==
+ 1
+ gp := getg()
+ if goexperiment.RuntimeSecret && isTiny && gp.secret > 0 {
+ return mallocgcSmallNoScanSC2(size, typ, needzero)
+ }
if doubleCheckMalloc {
if gcphase == _GCmarktermination {
throw("mallocgc called with gcphase == _GCmarktermination")
@@ -7907,7 +8244,6 @@
x := v
{
- gp := getg()
if goexperiment.RuntimeSecret && gp.secret > 0 {
addSecret(x)
@@ -7978,7 +8314,6 @@
gcStart(t)
}
}
- gp := getg()
if goexperiment.RuntimeSecret && gp.secret > 0 {
addSecret(x)
@@ -8002,6 +8337,12 @@
func mallocgcSmallNoScanSC12(size uintptr, typ *_type, needzero bool) unsafe.Pointer {
+ const isTiny = 0 ==
+ 1
+ gp := getg()
+ if goexperiment.RuntimeSecret && isTiny && gp.secret > 0 {
+ return mallocgcSmallNoScanSC2(size, typ, needzero)
+ }
if doubleCheckMalloc {
if gcphase == _GCmarktermination {
throw("mallocgc called with gcphase == _GCmarktermination")
@@ -8043,7 +8384,6 @@
x := v
{
- gp := getg()
if goexperiment.RuntimeSecret && gp.secret > 0 {
addSecret(x)
@@ -8114,7 +8454,6 @@
gcStart(t)
}
}
- gp := getg()
if goexperiment.RuntimeSecret && gp.secret > 0 {
addSecret(x)
@@ -8138,6 +8477,12 @@
func mallocgcSmallNoScanSC13(size uintptr, typ *_type, needzero bool) unsafe.Pointer {
+ const isTiny = 0 ==
+ 1
+ gp := getg()
+ if goexperiment.RuntimeSecret && isTiny && gp.secret > 0 {
+ return mallocgcSmallNoScanSC2(size, typ, needzero)
+ }
if doubleCheckMalloc {
if gcphase == _GCmarktermination {
throw("mallocgc called with gcphase == _GCmarktermination")
@@ -8179,7 +8524,6 @@
x := v
{
- gp := getg()
if goexperiment.RuntimeSecret && gp.secret > 0 {
addSecret(x)
@@ -8250,7 +8594,6 @@
gcStart(t)
}
}
- gp := getg()
if goexperiment.RuntimeSecret && gp.secret > 0 {
addSecret(x)
@@ -8274,6 +8617,12 @@
func mallocgcSmallNoScanSC14(size uintptr, typ *_type, needzero bool) unsafe.Pointer {
+ const isTiny = 0 ==
+ 1
+ gp := getg()
+ if goexperiment.RuntimeSecret && isTiny && gp.secret > 0 {
+ return mallocgcSmallNoScanSC2(size, typ, needzero)
+ }
if doubleCheckMalloc {
if gcphase == _GCmarktermination {
throw("mallocgc called with gcphase == _GCmarktermination")
@@ -8315,7 +8664,6 @@
x := v
{
- gp := getg()
if goexperiment.RuntimeSecret && gp.secret > 0 {
addSecret(x)
@@ -8386,7 +8734,6 @@
gcStart(t)
}
}
- gp := getg()
if goexperiment.RuntimeSecret && gp.secret > 0 {
addSecret(x)
@@ -8410,6 +8757,12 @@
func mallocgcSmallNoScanSC15(size uintptr, typ *_type, needzero bool) unsafe.Pointer {
+ const isTiny = 0 ==
+ 1
+ gp := getg()
+ if goexperiment.RuntimeSecret && isTiny && gp.secret > 0 {
+ return mallocgcSmallNoScanSC2(size, typ, needzero)
+ }
if doubleCheckMalloc {
if gcphase == _GCmarktermination {
throw("mallocgc called with gcphase == _GCmarktermination")
@@ -8451,7 +8804,6 @@
x := v
{
- gp := getg()
if goexperiment.RuntimeSecret && gp.secret > 0 {
addSecret(x)
@@ -8522,7 +8874,6 @@
gcStart(t)
}
}
- gp := getg()
if goexperiment.RuntimeSecret && gp.secret > 0 {
addSecret(x)
@@ -8546,6 +8897,12 @@
func mallocgcSmallNoScanSC16(size uintptr, typ *_type, needzero bool) unsafe.Pointer {
+ const isTiny = 0 ==
+ 1
+ gp := getg()
+ if goexperiment.RuntimeSecret && isTiny && gp.secret > 0 {
+ return mallocgcSmallNoScanSC2(size, typ, needzero)
+ }
if doubleCheckMalloc {
if gcphase == _GCmarktermination {
throw("mallocgc called with gcphase == _GCmarktermination")
@@ -8587,7 +8944,6 @@
x := v
{
- gp := getg()
if goexperiment.RuntimeSecret && gp.secret > 0 {
addSecret(x)
@@ -8658,7 +9014,6 @@
gcStart(t)
}
}
- gp := getg()
if goexperiment.RuntimeSecret && gp.secret > 0 {
addSecret(x)
@@ -8682,6 +9037,12 @@
func mallocgcSmallNoScanSC17(size uintptr, typ *_type, needzero bool) unsafe.Pointer {
+ const isTiny = 0 ==
+ 1
+ gp := getg()
+ if goexperiment.RuntimeSecret && isTiny && gp.secret > 0 {
+ return mallocgcSmallNoScanSC2(size, typ, needzero)
+ }
if doubleCheckMalloc {
if gcphase == _GCmarktermination {
throw("mallocgc called with gcphase == _GCmarktermination")
@@ -8723,7 +9084,6 @@
x := v
{
- gp := getg()
if goexperiment.RuntimeSecret && gp.secret > 0 {
addSecret(x)
@@ -8794,7 +9154,6 @@
gcStart(t)
}
}
- gp := getg()
if goexperiment.RuntimeSecret && gp.secret > 0 {
addSecret(x)
@@ -8818,6 +9177,12 @@
func mallocgcSmallNoScanSC18(size uintptr, typ *_type, needzero bool) unsafe.Pointer {
+ const isTiny = 0 ==
+ 1
+ gp := getg()
+ if goexperiment.RuntimeSecret && isTiny && gp.secret > 0 {
+ return mallocgcSmallNoScanSC2(size, typ, needzero)
+ }
if doubleCheckMalloc {
if gcphase == _GCmarktermination {
throw("mallocgc called with gcphase == _GCmarktermination")
@@ -8859,7 +9224,6 @@
x := v
{
- gp := getg()
if goexperiment.RuntimeSecret && gp.secret > 0 {
addSecret(x)
@@ -8930,7 +9294,6 @@
gcStart(t)
}
}
- gp := getg()
if goexperiment.RuntimeSecret && gp.secret > 0 {
addSecret(x)
@@ -8954,6 +9317,12 @@
func mallocgcSmallNoScanSC19(size uintptr, typ *_type, needzero bool) unsafe.Pointer {
+ const isTiny = 0 ==
+ 1
+ gp := getg()
+ if goexperiment.RuntimeSecret && isTiny && gp.secret > 0 {
+ return mallocgcSmallNoScanSC2(size, typ, needzero)
+ }
if doubleCheckMalloc {
if gcphase == _GCmarktermination {
throw("mallocgc called with gcphase == _GCmarktermination")
@@ -8995,7 +9364,6 @@
x := v
{
- gp := getg()
if goexperiment.RuntimeSecret && gp.secret > 0 {
addSecret(x)
@@ -9066,7 +9434,6 @@
gcStart(t)
}
}
- gp := getg()
if goexperiment.RuntimeSecret && gp.secret > 0 {
addSecret(x)
@@ -9090,6 +9457,12 @@
func mallocgcSmallNoScanSC20(size uintptr, typ *_type, needzero bool) unsafe.Pointer {
+ const isTiny = 0 ==
+ 1
+ gp := getg()
+ if goexperiment.RuntimeSecret && isTiny && gp.secret > 0 {
+ return mallocgcSmallNoScanSC2(size, typ, needzero)
+ }
if doubleCheckMalloc {
if gcphase == _GCmarktermination {
throw("mallocgc called with gcphase == _GCmarktermination")
@@ -9131,7 +9504,6 @@
x := v
{
- gp := getg()
if goexperiment.RuntimeSecret && gp.secret > 0 {
addSecret(x)
@@ -9202,7 +9574,6 @@
gcStart(t)
}
}
- gp := getg()
if goexperiment.RuntimeSecret && gp.secret > 0 {
addSecret(x)
@@ -9226,6 +9597,12 @@
func mallocgcSmallNoScanSC21(size uintptr, typ *_type, needzero bool) unsafe.Pointer {
+ const isTiny = 0 ==
+ 1
+ gp := getg()
+ if goexperiment.RuntimeSecret && isTiny && gp.secret > 0 {
+ return mallocgcSmallNoScanSC2(size, typ, needzero)
+ }
if doubleCheckMalloc {
if gcphase == _GCmarktermination {
throw("mallocgc called with gcphase == _GCmarktermination")
@@ -9267,7 +9644,6 @@
x := v
{
- gp := getg()
if goexperiment.RuntimeSecret && gp.secret > 0 {
addSecret(x)
@@ -9338,7 +9714,6 @@
gcStart(t)
}
}
- gp := getg()
if goexperiment.RuntimeSecret && gp.secret > 0 {
addSecret(x)
@@ -9362,6 +9737,12 @@
func mallocgcSmallNoScanSC22(size uintptr, typ *_type, needzero bool) unsafe.Pointer {
+ const isTiny = 0 ==
+ 1
+ gp := getg()
+ if goexperiment.RuntimeSecret && isTiny && gp.secret > 0 {
+ return mallocgcSmallNoScanSC2(size, typ, needzero)
+ }
if doubleCheckMalloc {
if gcphase == _GCmarktermination {
throw("mallocgc called with gcphase == _GCmarktermination")
@@ -9403,7 +9784,6 @@
x := v
{
- gp := getg()
if goexperiment.RuntimeSecret && gp.secret > 0 {
addSecret(x)
@@ -9474,7 +9854,6 @@
gcStart(t)
}
}
- gp := getg()
if goexperiment.RuntimeSecret && gp.secret > 0 {
addSecret(x)
@@ -9498,6 +9877,12 @@
func mallocgcSmallNoScanSC23(size uintptr, typ *_type, needzero bool) unsafe.Pointer {
+ const isTiny = 0 ==
+ 1
+ gp := getg()
+ if goexperiment.RuntimeSecret && isTiny && gp.secret > 0 {
+ return mallocgcSmallNoScanSC2(size, typ, needzero)
+ }
if doubleCheckMalloc {
if gcphase == _GCmarktermination {
throw("mallocgc called with gcphase == _GCmarktermination")
@@ -9539,7 +9924,6 @@
x := v
{
- gp := getg()
if goexperiment.RuntimeSecret && gp.secret > 0 {
addSecret(x)
@@ -9610,7 +9994,6 @@
gcStart(t)
}
}
- gp := getg()
if goexperiment.RuntimeSecret && gp.secret > 0 {
addSecret(x)
@@ -9634,6 +10017,12 @@
func mallocgcSmallNoScanSC24(size uintptr, typ *_type, needzero bool) unsafe.Pointer {
+ const isTiny = 0 ==
+ 1
+ gp := getg()
+ if goexperiment.RuntimeSecret && isTiny && gp.secret > 0 {
+ return mallocgcSmallNoScanSC2(size, typ, needzero)
+ }
if doubleCheckMalloc {
if gcphase == _GCmarktermination {
throw("mallocgc called with gcphase == _GCmarktermination")
@@ -9675,7 +10064,6 @@
x := v
{
- gp := getg()
if goexperiment.RuntimeSecret && gp.secret > 0 {
addSecret(x)
@@ -9746,7 +10134,6 @@
gcStart(t)
}
}
- gp := getg()
if goexperiment.RuntimeSecret && gp.secret > 0 {
addSecret(x)
@@ -9770,6 +10157,12 @@
func mallocgcSmallNoScanSC25(size uintptr, typ *_type, needzero bool) unsafe.Pointer {
+ const isTiny = 0 ==
+ 1
+ gp := getg()
+ if goexperiment.RuntimeSecret && isTiny && gp.secret > 0 {
+ return mallocgcSmallNoScanSC2(size, typ, needzero)
+ }
if doubleCheckMalloc {
if gcphase == _GCmarktermination {
throw("mallocgc called with gcphase == _GCmarktermination")
@@ -9811,7 +10204,6 @@
x := v
{
- gp := getg()
if goexperiment.RuntimeSecret && gp.secret > 0 {
addSecret(x)
@@ -9882,7 +10274,6 @@
gcStart(t)
}
}
- gp := getg()
if goexperiment.RuntimeSecret && gp.secret > 0 {
addSecret(x)
@@ -9906,6 +10297,12 @@
func mallocgcSmallNoScanSC26(size uintptr, typ *_type, needzero bool) unsafe.Pointer {
+ const isTiny = 0 ==
+ 1
+ gp := getg()
+ if goexperiment.RuntimeSecret && isTiny && gp.secret > 0 {
+ return mallocgcSmallNoScanSC2(size, typ, needzero)
+ }
if doubleCheckMalloc {
if gcphase == _GCmarktermination {
throw("mallocgc called with gcphase == _GCmarktermination")
@@ -9947,7 +10344,6 @@
x := v
{
- gp := getg()
if goexperiment.RuntimeSecret && gp.secret > 0 {
addSecret(x)
@@ -10018,7 +10414,6 @@
gcStart(t)
}
}
- gp := getg()
if goexperiment.RuntimeSecret && gp.secret > 0 {
addSecret(x)
diff --git a/src/runtime/malloc_stubs.go b/src/runtime/malloc_stubs.go
index 8c42493..58ca1d5 100644
--- a/src/runtime/malloc_stubs.go
+++ b/src/runtime/malloc_stubs.go
@@ -37,7 +37,7 @@
const sizeclass_ = 0
const noscanint_ = 0
const size_ = 0
-const isTiny_ = false
+const isTiny_ = 0
func malloc0(size uintptr, typ *_type, needzero bool) unsafe.Pointer {
if doubleCheckMalloc {
@@ -58,16 +58,15 @@
// to steer out of this codepath early if sanitizers are enabled.
func mallocStub(size uintptr, typ *_type, needzero bool) unsafe.Pointer {
- if isTiny_ {
- // secret code, need to avoid the tiny allocator since it might keep
- // co-located values alive longer and prevent timely zero-ing
- //
- // Call directly into the NoScan allocator.
- // See go.dev/issue/76356
- gp := getg()
- if goexperiment.RuntimeSecret && gp.secret > 0 {
- return mallocgcSmallNoScanSC2(size, typ, needzero)
- }
+ // secret code, need to avoid the tiny allocator since it might keep
+ // co-located values alive longer and prevent timely zero-ing
+ //
+ // Call directly into the NoScan allocator.
+ // See go.dev/issue/76356
+ const isTiny = isTiny_ == 1
+ gp := getg()
+ if goexperiment.RuntimeSecret && isTiny && gp.secret > 0 {
+ return mallocgcSmallNoScanSC2(size, typ, needzero)
}
if doubleCheckMalloc {
if gcphase == _GCmarktermination {
@@ -96,13 +95,10 @@
// Actually do the allocation.
x, elemsize := inlinedMalloc(size, typ, needzero)
- if !isTiny_ {
- gp := getg()
- if goexperiment.RuntimeSecret && gp.secret > 0 {
- // Mark any object allocated while in secret mode as secret.
- // This ensures we zero it immediately when freeing it.
- addSecret(x)
- }
+ if goexperiment.RuntimeSecret && gp.secret > 0 {
+ // Mark any object allocated while in secret mode as secret.
+ // This ensures we zero it immediately when freeing it.
+ addSecret(x)
}
// Notify valgrind, if enabled.