Wouter van Ooijen wrote: >>>> It isn't. The problem is that if say we assume heap allocation is twice >>>> as >>>> efficient as static worst case >>> You can assume whatever you like, the point is: how can you be sure? >> >> Because I wrote the program that makes the allocations and I understand >> how >> it works. >> >> For a current project I am working on I know that if I statically >> allocated >> everything that could exist on the heap it would take around 10 times >> more >> memory than the heap will ever use while it is running. > > If you feel sure about your analysis (sure enough to sit on en electric > chair connected to the 'out of memory' alarm)... And note that it is not > just about memory use, but also about fragmentation. > > My experience is that whenever I was *that* sure that malloc/free would > work it was because the problem could be reformulated to use array > elements. Wouter, aren't you being a wee bit too dramatic? Vitaliy -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist