Skip to content

Commit ff493e4

Browse files
Update to go/token/position
1 parent f5c911a commit ff493e4

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

compiler/natives/src/go/token/position.go

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,20 @@
33

44
package token
55

6-
import (
7-
"sync"
8-
"sync/atomic"
9-
"unsafe"
10-
)
6+
import "sync"
117

128
type FileSet struct {
139
mutex sync.RWMutex
1410
base int
1511
files []*File
1612

17-
// replaced atomic.Pointer[File] for go1.19 without generics
13+
// replaced atomic.Pointer[File] for go1.19 without generics.
1814
last atomicFilePointer
1915
}
2016

2117
type atomicFilePointer struct {
22-
v unsafe.Pointer
18+
v *File
2319
}
2420

25-
func (x *atomicFilePointer) Load() *File { return (*File)(atomic.LoadPointer(&x.v)) }
26-
func (x *atomicFilePointer) Store(val *File) { atomic.StorePointer(&x.v, unsafe.Pointer(val)) }
21+
func (x *atomicFilePointer) Load() *File { return x.v }
22+
func (x *atomicFilePointer) Store(val *File) { x.v = val }

0 commit comments

Comments
 (0)