Skip to content

Conversation

@lthibault
Copy link
Collaborator

@lthibault lthibault commented Mar 24, 2023

  • Release Arena when Message.Reset is called
  • Introduce Message.Release as shortcut for Message.Reset(nil)
  • Clean up Message.Reset(nil) call sites
  • Re-use CapTable slice in Message.

@lthibault lthibault requested a review from zenhack March 24, 2023 22:49
@lthibault lthibault self-assigned this Mar 24, 2023
@lthibault lthibault force-pushed the cleanup/message-reset branch from ce07157 to e07929b Compare March 24, 2023 23:39
Copy link
Contributor

@zenhack zenhack left a comment

Choose a reason for hiding this comment

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

Mostly looks good, a couple issues.

@lthibault
Copy link
Collaborator Author

@zenhack Comments addressed. As per my comment in Matrix, I felt it was best to turn OutgoingMessage and IncomingMessage into interfaces, so the diff has grown to include their respective call sites. Should be pretty straightforward though.

// *capnp.Message will be released. This will also release any clients
// in the message's CapTable and release its Arena.
//
// The Arena in the returned message should be fast at allocating new
Copy link
Contributor

Choose a reason for hiding this comment

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

Not really related to this PR (no need to address here) but: Is there actually a reason for this should? Afaik there's nothing in the RPC subsystem that would make SingleSegment a problem.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I always assumed it was because the PlaceArgs call might allocate lots of (potentially large) structs? In other words, it would be a case of "we're handing off control the user, so make sure we can handle whatever they do". 🤷‍♂️

@lthibault lthibault requested a review from zenhack March 28, 2023 16:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants