Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

internal: Add and use a generic pool instead of using sync.Pool directly #1262

Merged
merged 2 commits into from
Mar 21, 2023

Conversation

mway
Copy link
Member

@mway mway commented Mar 20, 2023

This replaces discretely-typed sync.Pool wrappers with a generic wrapper so that pools have a strongly-typed API rather than doing callsite type assertions.

@codecov
Copy link

codecov bot commented Mar 20, 2023

Codecov Report

Merging #1262 (280a9bb) into master (d1a1923) will decrease coverage by 0.15%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master    #1262      +/-   ##
==========================================
- Coverage   98.23%   98.08%   -0.15%     
==========================================
  Files          49       50       +1     
  Lines        3231     3240       +9     
==========================================
+ Hits         3174     3178       +4     
- Misses         49       53       +4     
- Partials        8        9       +1     
Impacted Files Coverage Δ
buffer/pool.go 100.00% <100.00%> (ø)
error.go 100.00% <100.00%> (ø)
internal/pool/pool.go 100.00% <100.00%> (ø)
stacktrace.go 100.00% <100.00%> (ø)
zapcore/console_encoder.go 100.00% <100.00%> (ø)
zapcore/entry.go 90.00% <100.00%> (-0.09%) ⬇️
zapcore/error.go 85.41% <100.00%> (-10.42%) ⬇️
zapcore/json_encoder.go 100.00% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@mway mway force-pushed the mway/generic-pool branch 2 times, most recently from 174bed1 to cb7832f Compare March 20, 2023 16:23
Copy link
Collaborator

@abhinav abhinav left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly nits and maintainability suggestions. LGTM otherwise.

internal/pool/pool.go Outdated Show resolved Hide resolved
internal/pool/pool.go Outdated Show resolved Hide resolved
internal/pool/pool.go Outdated Show resolved Hide resolved
internal/pool/pool.go Outdated Show resolved Hide resolved
internal/pool/pool_internals_test.go Outdated Show resolved Hide resolved
internal/pool/pool_norace_test.go Outdated Show resolved Hide resolved
internal/pool/pool_norace_test.go Outdated Show resolved Hide resolved
internal/pool/pool_race_test.go Outdated Show resolved Hide resolved
internal/pool/pool_race_test.go Outdated Show resolved Hide resolved
internal/pool/pool_race_test.go Outdated Show resolved Hide resolved
@mway mway merged commit 845ca51 into master Mar 21, 2023
@mway mway deleted the mway/generic-pool branch March 21, 2023 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants