* gnu/packages/golang.scm (go-github-com-libp2p-go-buffer-pool): New variable.
Change-Id: Id4de38a91dd7186e1aa6f06289c6bfa2cb0abbbb
---
gnu/packages/golang.scm | 36 ++++++++++++++++++++++++++++++++++++
1 file changed, 36 insertions(+)
Toggle diff (49 lines)
diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index 50ac5328c6..4efd2d1a36 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -4413,6 +4413,42 @@ (define-public go-github-com-gogo-protobuf
(home-page "https://github.com/gogo/protobuf")
(license license:bsd-3)))
+(define-public go-github-com-libp2p-go-buffer-pool
+ (package
+ (name "go-github-com-libp2p-go-buffer-pool")
+ (version "0.1.0")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/libp2p/go-buffer-pool")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "0514rsnin6wjqifpg66dp5nrwh40smqlkgs3kxyz9cansi78c2n1"))))
+ (build-system go-build-system)
+ (arguments
+ (list
+ #:import-path "github.com/libp2p/go-buffer-pool"))
+ (home-page "https://github.com/libp2p/go-buffer-pool")
+ (synopsis "Variable size buffer pool for Golang")
+ (description
+ "A variable size buffer pool for Golang.
+
+@code{go-buffer-pool} provides:
+@itemize
+@item @code{BufferPool}: A pool for re-using byte slices of varied sizes.
+This pool will always return a slice with at least the size requested and a capacity
+up to the next power of two. Each size class is pooled independently which makes the
+@code{BufferPool} more space efficient than a plain @code{sync.Pool} when used in
+situations where data size may vary over an arbitrary range.
+@item @code{Buffer}: a buffer compatible with @code{bytes.Buffer} but backed by a
+@code{BufferPool}. Unlike @code{bytes.Buffer}, @code{Buffer} will automatically
+shrink on read, using the buffer pool to avoid causing too much work for the
+allocator. This is primarily useful for long lived buffers that usually sit empty.
+@end itemize")
+ (license license:expat)))
+
(define-public go-github-com-libp2p-go-flow-metrics
(let ((commit "7e5a55af485341567f98d6847a373eb5ddcdcd43")
(revision "0"))
--
2.45.2