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

Add sync.Pool to Context for Map and Slice #1

Open
xdg opened this issue Feb 3, 2020 · 1 comment
Open

Add sync.Pool to Context for Map and Slice #1

xdg opened this issue Feb 3, 2020 · 1 comment

Comments

@xdg
Copy link
Collaborator

xdg commented Feb 3, 2020

With a sync.Pool in the Context, generators can use them to get new Maps and Slices, and then users can put them back in the pool via the context for reuse:

obj := factory(context)
// do stuff with obj
context.PutMap(obj)
@xdg
Copy link
Collaborator Author

xdg commented Feb 3, 2020

Would need to recursively walk Map/Slice looking for other Map/Slices to recycle.

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

No branches or pull requests

1 participant