Closed
Description
I'm creating a data structure that includes Box
es and Vec
s and Vec
s of Box
es, and I find myself between two choices:
- Have the top-level data structure own the
Allocator
and have each nested structure use the free&A
implementation - Require the
Allocator
to beClone
and justclone
it at each usage point
Based on this section in the docs:
cloning or moving the allocator must not invalidate memory blocks returned from this allocator. A cloned allocator must behave like the same allocator
it seems like the expected pattern is 2, and that therefore most allocators will be Clone
. Is that correct?
Metadata
Metadata
Assignees
Labels
No labels