== Quote from Jacob Carlborg (d...@me.com)'s article > On 2/14/10 19:17, Andrei Alexandrescu wrote: > > Currently new is baroque to the extreme. Should we eliminate the > > class-specific allocators in favor of a simple scheme for placement new? > > All that's really needed is to construct an object of a given type at a > > given address. All of the syntactic mess around it is unnecessary. > Didn't dsimcha or someone work on an implementation of a precise GC that > needed changes to this sort of things. If so, make sure you take those > changes into account.
Here's the deal with that: 1. The patch I created supported precise scanning of the heap, but not the stack or static data segment. This probably will be enough to solve **most** false pointer problems, simply because most memory is on the heap, not the stack or static data segment. 2. Pointer offset information for each type is determined at compile time using template metaprogramming. 3. The pointer offset info needs to be passed to the GC. My patch makes it so that this information can be passed when using GC.malloc directly. However, the new operator does not get to do compile time introspection on what it's allocating. Under the hood, it's simply passed RTTI, which does not contain enough information to generate pointer offset info from. One possible remedy for this is DIP8. http://www.prowiki.org/wiki4d/wiki.cgi?LanguageDevel/DIPs/DIP8