From efe0ad501eda10acc96d07652c03ebd9a8242311 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BA=90=E6=96=87=E9=9B=A8?= <41315874+fumiama@users.noreply.github.com> Date: Thu, 2 Oct 2025 14:33:12 +0800 Subject: [PATCH] feat(pbuf): add more defs --- pbuf/pbuf.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pbuf/pbuf.go b/pbuf/pbuf.go index b409ed3..b3b9026 100644 --- a/pbuf/pbuf.go +++ b/pbuf/pbuf.go @@ -10,6 +10,7 @@ import ( var bufferPool = NewBufferPool[struct{}]() type ( + Pool = BufferPool[struct{}] OBuffer = orbyte.Item[Buffer] Buffer = UserBuffer[struct{}] Bytes = UserBytes[struct{}] @@ -19,6 +20,11 @@ type BufferPool[USRDAT any] struct { *orbyte.Pool[UserBuffer[USRDAT]] } +// GetDefaultBufferPool exposes inner bufferPool value. +func GetDefaultBufferPool() Pool { + return bufferPool +} + func NewBufferPool[USRDAT any]() BufferPool[USRDAT] { return BufferPool[USRDAT]{ orbyte.NewPool[UserBuffer[USRDAT]](bufpooler[USRDAT]{}),