bufferpool

package
v1.8.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 4, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package bufferpool provides a pool of pre-registered RDMA buffers to avoid per-request allocation and registration overhead.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Pool

type Pool struct {
	// contains filtered or unexported fields
}

Pool manages a fixed set of RDMA-registered host memory buffers.

func NewPool

func NewPool(server *rdma.Server, bufSize, count int) (*Pool, error)

NewPool pre-allocates and registers count buffers of bufSize bytes each.

func (*Pool) Acquire

func (p *Pool) Acquire(ctx context.Context) (*rdma.Buffer, []byte, error)

Acquire blocks until a buffer is available or ctx is cancelled. Returns the buffer and its backing byte slice.

func (*Pool) Close

func (p *Pool) Close()

Close deregisters and frees all buffers. The pool must not be used afterward.

func (*Pool) Release

func (p *Pool) Release(buf *rdma.Buffer)

Release returns a buffer to the pool.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL