fieldalignment of all structs to save memory
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user