fieldalignment of all structs to save memory

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
2021-03-06 19:45:13 +03:00
parent cb70dfa664
commit bbbcb22565
65 changed files with 667 additions and 671 deletions

View File

@@ -10,11 +10,10 @@ import (
// Buffer is ring buffer
type Buffer struct {
size int
sync.RWMutex
vals []*Entry
streams map[string]*Stream
vals []*Entry
size int
sync.RWMutex
}
// Entry is ring buffer data entry
@@ -25,12 +24,12 @@ type Entry struct {
// Stream is used to stream the buffer
type Stream struct {
// Id of the stream
Id string
// Buffered entries
Entries chan *Entry
// Stop channel
Stop chan bool
// Id of the stream
Id string
}
// Put adds a new value to ring buffer