GCs in the news

H. S. Teoh via Digitalmars-d digitalmars-d at puremagic.com
Thu Jul 17 16:01:04 PDT 2014


On Thu, Jul 17, 2014 at 10:27:51PM +0000, Dicebot via Digitalmars-d wrote:
> On Thursday, 17 July 2014 at 22:21:54 UTC, Brad Anderson wrote:
> >Well the idea is that you then copy into an output range with
> >whatever allocation strategy you want at the end. There is quite a
> >bit of overlap I think. Not complete overlap and OutputRange
> >accepting functions will still be needed but I think we should prefer
> >the lazy approach where possible.
> 
> It is not always possible - sometimes resulting range element must be
> already "cooked" object.

Example?


> I do agree it is a powerful default when feasible though. At the same
> time simple output range overloads is much faster to add.

As Brad said, it's far easier to go from lazy to eager than the other
way round, e.g., by sticking .array at the end, or .copy(buf) where buf
is allocated according to whatever scheme the user chooses. Since buf is
declared by the user, the user is free to use whatever allocation
mechanism he wishes, the string algorithm doesn't know nor care what it
is (and it shouldn't need to).


T

-- 
What do you mean the Internet isn't filled with subliminal messages? What about all those buttons marked "submit"??


More information about the Digitalmars-d mailing list