On Thu, 26 Mar 2009 18:20:02 +0300, grauzone <n...@example.net> wrote:
> Sean Kelly wrote: >> Georg Wrede wrote: >>> >>> To do Systems Work on an embedded system, I'd like to see a D subset, >>> without GC, and which would essentially be like C with classes. I've >>> even toyed with the idea of having a D1toC translator for the job. >> >> With D2 you can drop in a different allocator to be used by the runtime >> -- there's an example implementation that simply calls malloc/free, for >> example. You'll leak memory if you perform string concatenation or use >> the AA, but otherwise everything works fine. > > You forgot the array literals (which almost look like harmless, > non-allocating array initializers), and the full closure delegates, > where the compiler will randomly choose to allocate or not to allocate > memory ("randomly" from the programmer's point of view). And of course > most library functions. > Tango is designed in a way to avoid any hidden allocations.