digitalmars.D - Compile-time branching on type size between segregator members during
- Per =?UTF-8?B?Tm9yZGzDtnc=?= (14/14) Sep 23 2018 After looking at
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?
Sep 23 2018