<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On 9 January 2014 13:08, Walter Bright <span dir="ltr"><<a href="mailto:newshound2@digitalmars.com" target="_blank">newshound2@digitalmars.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On 1/8/2014 12:23 PM, Benjamin Thaut wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Additionaly programming with a GC often leads to a lot more allocations,<br>
</blockquote>
<br></div>
I believe that this is incorrect. Using GC leads to fewer allocations, because you do not have to make extra copies just so it's clear who owns the allocations.<br></blockquote><div><br></div><div>You're making a keen assumption here that C programmers use STL. And no sane programmer that I've ever worked with uses STL precisely for this reason :P</div>
<div>Sadly, being conscious of eliminating unnecessary copies in C/C++ takes a lot of work (see: time and money), so there is definitely value in factoring that problem away, but the existing GC is broken. Until it doesn't leak, stop the world, and/or can run incrementally, it remains no good for realtime usage.</div>
<div>There were 2 presentations on improved GC's last year, why do we still have the lamest GC imaginable? I'm still yet to hear any proposal on how this situation will ever significantly improve...</div><div><br>
</div><div>*cough* ARC...</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
For example, if you've got an array of char* pointers, in D some can be GC allocated, some can be malloc'd, some can be slices, some can be pointers to string literals. In C/C++, the array has to decide on an ownership policy, and all elements must conform.<br>
<br>
This means extra copies.<br>
</blockquote></div><br></div></div>