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

Use a sync.Pool for MultiSegmentArenas #350

Merged
merged 2 commits into from
Nov 28, 2022

Conversation

zenhack
Copy link
Contributor

@zenhack zenhack commented Nov 27, 2022

Superseeds #347. note that relative to #347 this does a bit more work in cleanup to make sure memory is properly zeroed and we don't mis-report the number of segments when we get a new arena, though these weren't caught in testing on the other PR.

Benchmark results are similar.

While working on this, I caught a bug in the transport tests: the test assume that it is safe to call the ReleaseFunc returned from NewMessage multiple times, which was incidentally true before but undocmented. This patch documents this invariant, and also ensures that it holds even when release() actually does something with the arena.

While working on this, I caught a bug in the transport tests: the test
assume that it is safe to call the ReleaseFunc returned from NewMessage
multiple times, which was incidentally true before but undocmented. This
patch documents this invariant, and also ensures that it holds even when
release() actually does something with the arena.
@zenhack
Copy link
Contributor Author

zenhack commented Nov 27, 2022

Failure looks to be #349 again

lthibault
lthibault previously approved these changes Nov 27, 2022
Copy link
Collaborator

@lthibault lthibault left a comment

Choose a reason for hiding this comment

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

Approving, as this looks to be correct. See inline for a few questions and suggestions.

message.go Outdated Show resolved Hide resolved
message.go Show resolved Hide resolved
rpc/transport/transport.go Show resolved Hide resolved
@zenhack
Copy link
Contributor Author

zenhack commented Nov 27, 2022

Failure looks like #349 again

@lthibault lthibault merged commit 8231563 into capnproto:main Nov 28, 2022
@zenhack zenhack deleted the pool-multisegment branch November 28, 2022 01:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants