Optimize padding on Piece

This commit is contained in:
Matt Joiner 2020-09-29 16:37:58 +10:00
parent c2ba2aa417
commit 808fd4b382
2 changed files with 4 additions and 2 deletions

View File

@ -48,8 +48,8 @@ type Piece struct {
// length can be determined by the request chunkSize in use. // length can be determined by the request chunkSize in use.
_dirtyChunks bitmap.Bitmap _dirtyChunks bitmap.Bitmap
hashing bool
numVerifies int64 numVerifies int64
hashing bool
storageCompletionOk bool storageCompletionOk bool
publicPieceState PieceState publicPieceState PieceState

View File

@ -6,5 +6,7 @@ import (
) )
func TestPieceSize(t *testing.T) { 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)))
} }