Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
p2p
go-buffer-pool
Commits
8967793e
Commit
8967793e
authored
Dec 20, 2017
by
Steven Allen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add a Get/Put example
parent
3d6ef091
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
0 deletions
+27
-0
covout
covout
+17
-0
pool_test.go
pool_test.go
+10
-0
No files found.
covout
0 → 100644
View file @
8967793e
mode: set
github.com/libp2p/go-buffer-pool/pool.go:51.48,52.17 1 1
github.com/libp2p/go-buffer-pool/pool.go:55.2,56.43 2 1
github.com/libp2p/go-buffer-pool/pool.go:59.2,59.38 1 1
github.com/libp2p/go-buffer-pool/pool.go:52.17,54.3 1 1
github.com/libp2p/go-buffer-pool/pool.go:56.43,58.3 1 1
github.com/libp2p/go-buffer-pool/pool.go:63.38,65.26 2 1
github.com/libp2p/go-buffer-pool/pool.go:68.2,68.43 1 1
github.com/libp2p/go-buffer-pool/pool.go:71.2,72.23 2 1
github.com/libp2p/go-buffer-pool/pool.go:65.26,66.16 1 0
github.com/libp2p/go-buffer-pool/pool.go:68.43,70.3 1 1
github.com/libp2p/go-buffer-pool/pool.go:77.32,79.2 1 1
github.com/libp2p/go-buffer-pool/pool.go:82.24,84.2 1 1
github.com/libp2p/go-buffer-pool/pool.go:87.36,89.2 1 1
github.com/libp2p/go-buffer-pool/pool.go:92.38,94.32 2 1
github.com/libp2p/go-buffer-pool/pool.go:97.2,97.17 1 1
github.com/libp2p/go-buffer-pool/pool.go:94.32,96.3 1 1
pool_test.go
View file @
8967793e
...
...
@@ -144,3 +144,13 @@ func BenchmarkPoolOverlflow(b *testing.B) {
}
})
}
func
ExampleGet
()
{
buf
:=
Get
(
100
)
fmt
.
Println
(
"length"
,
len
(
buf
))
fmt
.
Println
(
"capacity"
,
cap
(
buf
))
Put
(
buf
)
// Output:
// length 100
// capacity 128
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment