Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrOverflow returned if requested buffer number larget then max number. ErrOverflow = errors.New("buffer number overflow") )
Functions ¶
This section is empty.
Types ¶
type Buffer ¶
type Buffer struct { B []byte // contains filtered or unexported fields }
Buffer ...
type BufferRegistry ¶
BufferRegistry ...
type Pool ¶
type Pool struct {
// contains filtered or unexported fields
}
Pool manages registered offheap buffers. Allocated with MAP_ANON | MAP_PRIVATE. TODO performance is not really excellent, several ideas to try: - backoff on contention (runtime.Gosched achieves same purpose) - elimitation array This is much better than mutex-based version (3.5 times faster), but much more worse than simple sync.Pool (10 times slower).
func New ¶
func New(reg BufferRegistry, bufsize, size int) (*Pool, error)
New will initialize mmap'ed memory region, of the total size 16 bytes + size*bufsize and register mmap'ed memory as buffer in io_uring.
Click to show internal directories.
Click to hide internal directories.