From 808fd4b3825a26b026138ccad699aff9c4710fc9 Mon Sep 17 00:00:00 2001 From: Matt Joiner Date: Tue, 29 Sep 2020 16:37:58 +1000 Subject: [PATCH] Optimize padding on Piece --- piece.go | 2 +- piece_test.go | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/piece.go b/piece.go index fd0eb68a..2e6a4259 100644 --- a/piece.go +++ b/piece.go @@ -48,8 +48,8 @@ type Piece struct { // length can be determined by the request chunkSize in use. _dirtyChunks bitmap.Bitmap - hashing bool numVerifies int64 + hashing bool storageCompletionOk bool publicPieceState PieceState diff --git a/piece_test.go b/piece_test.go index 1843f95d..1e030b52 100644 --- a/piece_test.go +++ b/piece_test.go @@ -6,5 +6,7 @@ import ( ) func TestPieceSize(t *testing.T) { - t.Logf("%v", unsafe.Sizeof(Piece{})) + t.Log("[]*File", unsafe.Sizeof([]*File(nil))) + t.Log("Piece", unsafe.Sizeof(Piece{})) + t.Log("map[*peer]struct{}", unsafe.Sizeof(map[*peer]struct{}(nil))) }