From 59d9f605c5b0e957e159a526a3779188d5b039ea Mon Sep 17 00:00:00 2001 From: Dominic Della Valle Date: Mon, 15 May 2023 10:24:32 -0400 Subject: [PATCH] cgofuse/lock: lint - struct alignment This shouldn't change the size of the struct, but it does reduce the pointer bytes inspected by the garbage collector by half*. *at least on amd64 when using `gc` --- internal/filesystem/cgofuse/lock/lock.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/filesystem/cgofuse/lock/lock.go b/internal/filesystem/cgofuse/lock/lock.go index 0167234e..d67d4623 100644 --- a/internal/filesystem/cgofuse/lock/lock.go +++ b/internal/filesystem/cgofuse/lock/lock.go @@ -21,8 +21,8 @@ type ( // PathLocker is a hierarchical path locker, // inspired by Ritik Malhotra's paper on path-based locks. PathLocker struct { - lockTableMu sync.Mutex lockTable pathLockerMap + lockTableMu sync.Mutex } // UnlockFunc must be called after an operation completes. // Typically a single defer statement is used