September 23, 2018 Compile-time branching on type size between segregator members during segregator. allocate() | ||||
---|---|---|---|---|
| ||||
After looking at https://www.youtube.com/watch?v=kaA3HPgowwY and std.experimental.allocator.building_blocks.segregator.Segregator I wonder if Segregator.allocate() is missing an important optimization on calls to someSegregatorInstance.make!T() where the choice of selecting the right segregator member can be done at _compile-time_ instead of run-time because `T.sizeof` is known at compile time. If so, what about adding an optional member to the allocator API, say, void[] allocate(size_t s)() that can realize this idea? |
Copyright © 1999-2021 by the D Language Foundation