D on next-gen consoles and for game development

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Thu May 23 17:44:13 PDT 2013


On 5/23/13 7:42 PM, Manu wrote:
> I've always steered away from things like this because it creates a
> double-indirection.

There's no double indirection for the payload.

> I have thought of making a similar RefCounted template, but where the
> refCount is stored in a hash table, and the pointer is used to index the
> table.
> This means the refCount doesn't pollute the class/structure being
> ref-counted, or avoids a double-indirection on general access.

But that's worse than non-intrusive refcounting, and way worse than 
intrusive refcounting (which should be the elective method for classes).

> Custom allocators will probably be very useful, but if there's one thing
> STL has taught me, it's hard to use them effectively, and in practise,
> nobody ever uses them.

Agreed.

> One problem is the implicit allocation functions (array concatenation,
> AA's, etc). How to force those to allocate somewhere else for the scope?

I have some ideas.


Andrei



More information about the Digitalmars-d mailing list