mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-01-08 05:09:46 -06:00
Merge pull request #1888 from wnienhaus/fix-unaligned-atomic-operation-on-arm32
move uint64s to beginning of struct to ensure they are 64-bit aligned
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
Bugfix: Fixes "unaligned 64-bit atomic operation" panic on 32-bit ARM
|
||||
|
||||
sync/cache had uint64s that were not 64-bit aligned causing panics
|
||||
on 32-bit systems during atomic access
|
||||
|
||||
https://github.com/owncloud/ocis/pull/1888
|
||||
https://github.com/owncloud/ocis/issues/1887
|
||||
@@ -8,10 +8,11 @@ import (
|
||||
|
||||
// Cache is a barebones cache implementation.
|
||||
type Cache struct {
|
||||
// capacity and length have to be the first words
|
||||
// in order to be 64-aligned on 32-bit architectures.
|
||||
capacity, length uint64 // access atomically
|
||||
entries sync.Map
|
||||
pool sync.Pool
|
||||
capacity uint64
|
||||
length uint64
|
||||
}
|
||||
|
||||
// CacheEntry represents an entry on the cache. You can type assert on V.
|
||||
|
||||
Reference in New Issue
Block a user