Skip to content

Pooled Objects - Recursive Pool Usage #162

Description

@steve-gray

When unmarshalling an object from a pooled instance, the pooling support should be able to use pooled instances all the way down as it grabs and allocates objects. For example if:

message SomeMessage {
    SecondMessage header = 1;
    repeated OtherMessage items = 2;
}

Even if I pool the outer object, only that level is being serviced from the pool. As it expands the children, these are always new allocations today.

When unmarshalling into a pooled instance, I feel there should be a code path that obtains all instances down the tree (regardless of object depth) from the pools. An additional helper method that returns all instances to the pool would likewise be be valuable. This would enable complex structures to make use of pooling.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions