mirror of
https://github.com/jech/galene.git
synced 2024-11-09 02:05:59 +01:00
Remove padding in packetcache.
Since the packet entries are already overdimensioned, there's no need to add additional padding.
This commit is contained in:
parent
d723d20ee6
commit
b7a680671d
2 changed files with 0 additions and 12 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue