Commit b7a68067 authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Remove padding in packetcache.

Since the packet entries are already overdimensioned, there's no
need to add additional padding.
parent d723d20e
......@@ -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 {
......
......@@ -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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment