TempAlloc review starts now

dsimcha dsimcha at yahoo.com
Mon Jun 6 10:58:04 PDT 2011


== Quote from Steven Schveighoffer (schveiguy at yahoo.com)'s article
> On Mon, 06 Jun 2011 08:51:27 -0400, dsimcha <dsimcha at yahoo.com> wrote:
> > On 6/6/2011 7:24 AM, Timon Gehr wrote:
> >> simendsjo wrote:
> >>> I have very limited experience with D and haven't taken the time to
> >>> understood the code, but here are
> >>> some easy nitpicks :)
> >>> ----
> >>> imports: Should stuff in core really depend on phobos? Isn't much of
> >>> the
> >>> reason for core to allow
> >>> different "standard" libraries like tango?
> >>> [snip.]
> >>
> >> Actually the code doesn't depend on phobos. You can change the set of
> >> imports to:
> >>
> >> import core.memory, core.exception, core.stdc.string;
> >> static import core.stdc.stdlib;
> >>
> >> It will still compile. Good point though. That needs to be changed.
> >>
> >>
> >> Timon
> >
> > Wow.  I have no idea how these dependencies on Phobos slipped past me.
> > Probably because I'm so used to thinking of std.range, std.algorithm,
> > etc. as fundamental parts of the language.  They absolutely, 110% must
> > be gotten rid of if this is to go into druntime.  This may necessitate
> > breaking this proposal up into two:  TempAlloc itself in druntime and
> > the higher level convenience functions (tempdup, stackCat, etc.) in
> > std.array.
> Without actually even looking at it (yet), I don't see why this goes into
> druntime in the first place.  From my experience with druntime, things
> should go in there only if the compiler or runtime needs them to work.  Is
> there a proposed usage for TempAlloc in druntime or for the compiler?
> -Steve

You may be right.  Someone (I think it was Andrei or Sean) suggested core.memory.
 I would be fine with moving it to Phobos instead.


More information about the Digitalmars-d mailing list