Cristian Vlasceanu wrote: >>> Do custom-allocated objects live on the GC-ed heap? >> Not necessarily, e.g. you can malloc some memory and then create an object >> there. >> > > I was afraid that may be the case, and it is perhaps not a good idea. > > ... > > This is why D .net does not support any of this custom allocator nonsense. > > > My two Global-Currency / 100 > > Cristi
It's funny, but I was recently doing some game prototyping and needed a very fast, garbage-free way of allocating lots of small, short-lived objects. I thought "Ha! I have a block allocator mixin for just this purpose!" ...until I remembered I was programming in C# and not D. So now I have to create an array of pre-allocated objects, and have a protocol for assigning and returning them. Plus, I have to have a unique pool for each subclass since I can't use casts to override the type system. Urgh. -- Daniel