On Wed, Oct 7, 2009 at 12:07 PM, Gerhard Fiedler wrote: > One of the main issues here is that dynamic memory is not predictable. > Usually you need to make sure that in the worst case scenario (per spec) > the available memory is enough (queue length, etc.) With dynamic memory, > you don't even know before-hand how much usable memory you have, due to > fragmentation. Only a 'designed' memory solution can give you that. With > this in mind, malloc et al is generally out of the picture anyway. > In many cases a "double-pointer" (or in more fashionable naming a memory handler) should be used for dynamic memories instead of pure pointers, so that when the memory is fragmented you can do a garbage collection. The only problem is when are you going to start the garbage collector so that it will not affect the device functionality -- in many systems you can initiate it manually when you know you have enough time to finish, while some other system the os / memory manager do that automatically for you (like .NET brrr, or Java or Mac 68k, and even Apple II with the Apple Basic had this kind of approach). Again, not sure if you want to get into trouble like this on an MCU. Tamas > > Gerhard > -- > http://www.piclist.com PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist > -- http://www.mcuhobby.com -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist