diff --git a/packetcache/packetcache.go b/packetcache/packetcache.go index 1103db0..215c183 100644 --- a/packetcache/packetcache.go +++ b/packetcache/packetcache.go @@ -10,7 +10,6 @@ type entry struct { seqno uint16 length uint16 buf [BufSize]byte - pad [32 - (BufSize+4)%32]byte // avoid false sharing } type Cache struct { diff --git a/packetcache/packetcache_test.go b/packetcache/packetcache_test.go index 70a8ae7..fd3ffc6 100644 --- a/packetcache/packetcache_test.go +++ b/packetcache/packetcache_test.go @@ -5,7 +5,6 @@ import ( "math/rand" "sync" "testing" - "unsafe" "github.com/pion/rtcp" ) @@ -82,16 +81,6 @@ func TestCacheOverflow(t *testing.T) { } } -func TestCacheAlignment(t *testing.T) { - cache := New(16) - for i := range cache.entries { - p := unsafe.Pointer(&cache.entries[i]) - if uintptr(p)%32 != 0 { - t.Errorf("%v: alignment %v", i, uintptr(p)%32) - } - } -} - func TestBitmap(t *testing.T) { value := uint64(0xcdd58f1e035379c0) packet := make([]byte, 1)