D vs C++ - Where are the benchmarks?
H. S. Teoh
hsteoh at quickfur.ath.cx
Thu Jul 4 15:26:41 PDT 2013
On Thu, Jul 04, 2013 at 11:20:47PM +0200, Mehrdad wrote:
> On Thursday, 4 July 2013 at 21:11:57 UTC, Jonathan M Davis wrote:
[...]
> >My point was that it's perfectly possible to write C++ code which
> >uses a GC, not that it was normal or easy.
>
> No, the point is that it would only with a particular C++ compiler.
> It's not "C++" code if a C++ compiler can't run it correctly. That
> would make it "a vendor-specific language similar to C++" code.
Really? I thought there are conservative GC's out there for C++ (and
even C, IIRC). It's not too much different from D's GC, actually. You
just override malloc/free in the library (or operator new and operator
delete, as the case may be), then have a GC thread scan the runtime
stack for roots.
Of course, only a conservative GC is possible, since you don't know
what's a real pointer and what's just an integer value that happens to
look like a pointer. But it's definitely possible.
T
--
Без труда не выловишь и рыбку из пруда.
More information about the Digitalmars-d
mailing list