syncthing/lib/scanner
Aurélien Rainone f1a7dd766e all: Add comment to ensure correct atomics alignment (fixes #5813)
Per the sync/atomic bug note:

> On ARM, x86-32, and 32-bit MIPS, it is the caller's
> responsibility to arrange for 64-bit alignment of 64-bit words
> accessed atomically. The first word in a variable or in an
> allocated struct, array, or slice can be relied upon to be
> 64-bit aligned.

All atomic accesses of 64-bit variables in syncthing code base are
currently ok (i.e they are all 64-bit aligned).

Generally, the bug is triggered because of incorrect alignement
of struct fields. Free variables (declared in a function) are
guaranteed to be 64-bit aligned by the Go compiler.

To ensure the code remains correct upon further addition/removal
of fields, which would change the currently correct alignment, I
added the following comment where required:

     // atomic, must remain 64-bit aligned

See https://golang.org/pkg/sync/atomic/#pkg-note-BUG.
2019-07-13 14:05:39 +01:00
..
testdata lib/ignore, lib/scanner: Catch included items below ignored ones (#4811) 2018-05-14 09:47:23 +02:00
.gitignore Add benchmark of HashFile 2015-10-27 09:30:34 +01:00
blockqueue.go all: Display errors while scanning in web UI (fixes #4480) (#5215) 2018-11-07 11:04:41 +01:00
blocks.go lib/scanner: Use standard adler32 when we don't need rolling (#5556) 2019-02-25 13:29:31 +04:00
blocks_test.go all: Revert the underscore sillyness 2019-02-02 12:16:27 +01:00
debug.go all: Update license url to https (ref #3976) 2017-02-09 08:04:16 +01:00
doc.go all: Update license url to https (ref #3976) 2017-02-09 08:04:16 +01:00
virtualfs_test.go all: Copy owner/group from parent (fixes #5445) (#5479) 2019-01-25 09:52:21 +01:00
walk.go all: Add comment to ensure correct atomics alignment (fixes #5813) 2019-07-13 14:05:39 +01:00
walk_test.go all: Remove "large blocks" config (#5763) 2019-06-06 15:57:38 +01:00