File tree Expand file tree Collapse file tree 1 file changed +16
-14
lines changed Expand file tree Collapse file tree 1 file changed +16
-14
lines changed Original file line number Diff line number Diff line change @@ -1333,12 +1333,16 @@ func (n *nodeContext) clone() *nodeContext {
1333
1333
}
1334
1334
1335
1335
func (c * OpContext ) newNodeContext (node * Vertex ) * nodeContext {
1336
- if n := c .freeListNode ; n != nil {
1336
+ var n * nodeContext
1337
+ if n = c .freeListNode ; n != nil {
1337
1338
c .stats .Reused ++
1338
1339
c .freeListNode = n .nextFree
1339
1340
1341
+ n .scheduler .clear ()
1342
+ n .scheduler .ctx = c
1343
+
1340
1344
* n = nodeContext {
1341
- scheduler : scheduler { ctx : c } ,
1345
+ scheduler : n . scheduler ,
1342
1346
node : node ,
1343
1347
nodeContextState : nodeContextState {
1344
1348
kind : TopKind ,
@@ -1367,21 +1371,19 @@ func (c *OpContext) newNodeContext(node *Vertex) *nodeContext {
1367
1371
buffer : n .buffer [:0 ],
1368
1372
}
1369
1373
n .scheduler .clear ()
1370
- n .scheduler .node = n
1371
- n .underlying = node
1372
-
1373
- return n
1374
- }
1375
- c .stats .Allocs ++
1374
+ } else {
1375
+ c .stats .Allocs ++
1376
1376
1377
- n : = & nodeContext {
1378
- scheduler : scheduler {
1379
- ctx : c ,
1380
- },
1381
- node : node ,
1377
+ n = & nodeContext {
1378
+ scheduler : scheduler {
1379
+ ctx : c ,
1380
+ },
1381
+ node : node ,
1382
1382
1383
- nodeContextState : nodeContextState {kind : TopKind },
1383
+ nodeContextState : nodeContextState {kind : TopKind },
1384
+ }
1384
1385
}
1386
+
1385
1387
n .scheduler .node = n
1386
1388
n .underlying = node
1387
1389
return n
You can’t perform that action at this time.
0 commit comments