We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f5c911a commit ff493e4Copy full SHA for ff493e4
compiler/natives/src/go/token/position.go
@@ -3,24 +3,20 @@
3
4
package token
5
6
-import (
7
- "sync"
8
- "sync/atomic"
9
- "unsafe"
10
-)
+import "sync"
11
12
type FileSet struct {
13
mutex sync.RWMutex
14
base int
15
files []*File
16
17
- // replaced atomic.Pointer[File] for go1.19 without generics
+ // replaced atomic.Pointer[File] for go1.19 without generics.
18
last atomicFilePointer
19
}
20
21
type atomicFilePointer struct {
22
- v unsafe.Pointer
+ v *File
23
24
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)) }
+func (x *atomicFilePointer) Load() *File { return x.v }
+func (x *atomicFilePointer) Store(val *File) { x.v = val }
0 commit comments