<div dir="ltr">On 25 May 2013 15:29, deadalnix <span dir="ltr"><<a href="mailto:deadalnix@gmail.com" target="_blank">deadalnix@gmail.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On Saturday, 25 May 2013 at 05:18:12 UTC, Manu wrote:<br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
On 25 May 2013 15:00, deadalnix <<a href="mailto:deadalnix@gmail.com" target="_blank">deadalnix@gmail.com</a>> wrote:<br>
<br>
</div><div><div class="h5"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On Saturday, 25 May 2013 at 01:56:42 UTC, Manu wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Understand, I have no virtual-memory manager, it won't page, it's not a<br>
performance problem, it will just crash if I mis-calculate this value.<br>
<br>
</blockquote>
<br>
So the GC is kind of out.<br>
<br>
</blockquote>
<br></div></div><div class="im">
Yeah, I'm wondering if that's just a basic truth for embedded.<br>
Can D implement a ref-counting GC? That would probably still be okay, since<br>
collection is immediate.<br>
<br>
</div></blockquote>
<br>
This is technically possible, but you said you make few allocations. So with the tax on pointer write or the reference counting, you'll pay a lot to collect very few garbages. I'm not sure the tradeoff is worthwhile.<br>
</blockquote><div><br></div><div style>But it would be deterministic, and if the allocations are few, the cost should be negligible.</div><div style><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

Paradoxically, when you create few garbage, GC are really goos as they don't need to trigger often. But if you need to add a tax on each reference write/copy, you'll probably pay more tax than you get out of it.</blockquote>
<div><br></div><div style>They're still non-deterministic though. And unless (even if?) they're precise, they might leak.<br></div><div style><br>What does ObjC do? It seems to work okay on embedded hardware (although not particularly memory-constrained hardware).</div>
<div style>Didn't ObjC recently reject GC in favour of refcounting?</div></div></div></div>