Hacker News new | ask | show | jobs
by nakkaya 5463 days ago
The reason I used ref counting instead of a proper garbage collector is that, most microconstollers have couple kilobytes of ram (a ATmega328 has 2KB) every garbage collection scheme I've looked at was using a lot of ram, plus ref counting is slow but it is predictively slow, if you are taking measurements at 100 times a second it will always be 100 times a second, you won't have pauses right in the middle of the routine (or say when you are in the air making a maneuver).
1 comments

It's a myth that malloc/free is constant-time in a reference-counting scheme. If you are doing real-time programming, malloc/free should be avoided as much as garbage collection.