On Mon, 12 Sep 2011 04:37:17 +0900, dsimcha <[email protected]> wrote:
== Quote from dsimcha ([email protected])'s article
== Quote from Masahiro Nakagawa ([email protected])'s article
> On Mon, 12 Sep 2011 01:51:02 +0900, dsimcha <[email protected]> wrote:
> > 8. The high-level, templated allocator functions now have a default
> > implementation in terms of lower-level allocator functionality,
provided
> > by the TypedAllocatorMixin mixin in std.allocators.allocator. The
idea
> > is that an allocator may have better ways of accomplishing this
stuff,
> > but this mixin is usually a reasonable default and will avoid code
> > duplication across allocators. I'm leery of including it in the
> > DynamicAllocator interface, though, because for some allocators it's
> > just plain wrong. For example, the default array() implementation
just
> > plain wouldn't work with RegionAllocator for huge ranges.
> I think Default(Templated)AllocatorFunctions are better
> than TypedAllocatorMixin. TypedAllocator is not clear for me.
> I will read documents and codes later.
If you mean just making functions like T newArray(Allocator)(Allocator
allocator,
size_t size), etc., I've mentioned before that having the type
available to the
allocator is often useful and therefore these defaults need to be
overrideable.
Otherwise, please clarify.
Oh wait a minute, do you just mean the name of the mixin template? If
so, I
completely agree that your suggested name is better.
Yes. I mentioned the name of mixin template.