diff options
author | Artyom V. Poptsov <poptsov.artyom@gmail.com> | 2024-08-11 00:09:53 +0300 |
---|---|---|
committer | Sharlatan Hellseher <sharlatanus@gmail.com> | 2024-08-21 12:14:17 +0100 |
commit | 8076ca2042fac1f89ece1dd8186b7fee3c0183ef (patch) | |
tree | ebf489e2f95f550040751d47825bd703a924c1d8 /gnu | |
parent | 158ee2c76aa0d859b7487aee907c2d92d116671f (diff) | |
download | guix-8076ca2042fac1f89ece1dd8186b7fee3c0183ef.tar guix-8076ca2042fac1f89ece1dd8186b7fee3c0183ef.tar.gz |
gnu: Add go-github-com-libp2p-go-buffer-pool.
* gnu/packages/golang-xyz.scm (go-github-com-libp2p-go-buffer-pool): New variable.
Change-Id: Id4de38a91dd7186e1aa6f06289c6bfa2cb0abbbb
Signed-off-by: Sharlatan Hellseher <sharlatanus@gmail.com>
Diffstat (limited to 'gnu')
-rw-r--r-- | gnu/packages/golang-xyz.scm | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/gnu/packages/golang-xyz.scm b/gnu/packages/golang-xyz.scm index ae0b481ae5..9420fa16c4 100644 --- a/gnu/packages/golang-xyz.scm +++ b/gnu/packages/golang-xyz.scm @@ -3389,6 +3389,44 @@ pattern is called repeatedly.") database/sql package.") (license license:expat))) +(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 + "This package provides 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") + ;; There are two license files provided by the project: LICENSE and + ;; LICENSE-BSD. + (license (list license:expat license:bsd-3)))) + (define-public go-github-com-logrusorgru-aurora (package (name "go-github-com-logrusorgru-aurora") |