Skip to content

Pooled Objects - Recursive Pool Usage #162

@steve-gray

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.

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