3 ms·
is a gc all that relevant if you're not dynamically allocating in either case?
by abiox 9y ago
is a gc all that relevant if you're not dynamically allocating in either case?
- vvanders 9y agoGarbage collection by its nature implies dynamic allocation. You're using value types and raw pointers in those targets because even the memory overhead of a heap/freelist/etc can be too much. With things like AVR you're looking at 512B to 16kB of total memory(part of which includes the code you write).
- abiox 9y ago> Garbage collection by its nature implies dynamic allocation i'm not sure i follow - you're saying that a gc existing implies that one cannot preallocate and avoid dynamic allocation?
- vvanders 9y ago> preallocate This will still use dynamic allocation to do the preallocation. You'll have a heap to track this which comes with its own overhead.
- abiox 9y agoi guess i was using 'dynamic allocation' to mean allocation that occurs in the midst of the main control flow, likely in response to some conditional evaluation (vs upfront).
- vvanders 9y agoYeah, if you allocate in the main loop or preallocate you're still going to pay the overhead of a heap to keep track of those allocation :).