mirror of
https://github.com/slackhq/nebula.git
synced 2025-11-23 08:54:25 +01:00
a little cleaner
This commit is contained in:
@@ -43,13 +43,11 @@ type SplitQueue struct {
|
||||
// NewSplitQueue allocates a new [SplitQueue] in memory. The given queue size
|
||||
// specifies the number of entries/buffers the queue can hold. This also affects
|
||||
// the memory consumption.
|
||||
func NewSplitQueue(queueSize int) (_ *SplitQueue, err error) {
|
||||
func NewSplitQueue(queueSize int, itemSize int) (_ *SplitQueue, err error) {
|
||||
if err = CheckQueueSize(queueSize); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
itemSize := os.Getpagesize() * 4 //todo config
|
||||
|
||||
if itemSize%os.Getpagesize() != 0 {
|
||||
return nil, errors.New("split queue size must be multiple of os.Getpagesize()")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user