Skip to content

Commit dbed3d2

Browse files
committed
internal/core/adt: drop overlayContext.generation
The field hasn't been used for a while, and the global nextGeneration counter was causing data races in parallel tests which used multiple cue.Contexts concurrently. Signed-off-by: Daniel Martí <[email protected]> Change-Id: I7f83556323d6d228312699fad33c6d57ffbdb1bf Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1212032 Unity-Result: CUE porcuepine <[email protected]> TryBot-Result: CUEcueckoo <[email protected]> Reviewed-by: Marcel van Lohuizen <[email protected]>
1 parent 5e5179c commit dbed3d2

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

internal/core/adt/overlay.go

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,8 @@ import "slices"
3838
// TODO(perf): implement copy on write: instead of copying the entire tree, we
3939
// could get by with only copying arcs to that are modified in the copy.
4040

41-
var nextGeneration int
42-
4341
func newOverlayContext(ctx *OpContext) *overlayContext {
44-
nextGeneration++
45-
return &overlayContext{ctx: ctx, generation: nextGeneration}
42+
return &overlayContext{ctx: ctx}
4643
}
4744

4845
// An overlayContext keeps track of copied vertices, closeContexts, and tasks.
@@ -51,12 +48,6 @@ func newOverlayContext(ctx *OpContext) *overlayContext {
5148
type overlayContext struct {
5249
ctx *OpContext
5350

54-
// generation is used to identify the current overlayContext. All
55-
// closeContexts created by this overlayContext will have this generation.
56-
// Whenever a counter of a closedContext is changed, this may only cause
57-
// a cascade of changes if the generation is the same.
58-
generation int
59-
6051
// vertices holds the original, non-overlay vertices. The overlay for a
6152
// vertex v can be obtained by looking up v.cc.overlay.src.
6253
vertices []*Vertex

0 commit comments

Comments
 (0)