make 64bit atomics also align on 32bit (#2386)

do this by simply putting them at the front of each struct
see https://pkg.go.dev/sync/atomic#pkg-note-BUG

fixes #2383

Co-authored-by: akarl10 <mike@mwys.mine.bz>
This commit is contained in:
akarl10
2024-02-17 11:44:55 -08:00
committed by GitHub
co-authored by akarl10
parent 110cc83508
commit 7658e1b60d
3 changed files with 17 additions and 7 deletions
+4 -1
View File
@@ -137,6 +137,10 @@ type ParticipantParams struct {
}
type ParticipantImpl struct {
// utils.TimedVersion is a atomic. To be correctly aligned also on 32bit archs
// 64it atomics need to be at the front of a struct
timedVersion utils.TimedVersion
params ParticipantParams
isClosed atomic.Bool
@@ -200,7 +204,6 @@ type ParticipantImpl struct {
dirty atomic.Bool
version atomic.Uint32
timedVersion utils.TimedVersion
// callbacks & handlers
onTrackPublished func(types.LocalParticipant, types.MediaTrack)