Tamas Rudnai wrote: > I was talking about memory leak problems and buffer overrun problems where > the memory mapping information can be corrupted (depending on how the > memory > manager keeps track of the used/unused memory regions). For example if the > memory region is a linked list, then an inappropriate pointer can destroy > one the link that could cause virtually loosing the control over the > heap -- > a reset can only satisfactory solve the problem. This is a "guilty by association" fallacy. You're describing a problem that is caused by bugs in the program. It has nothing to do with DA. You might as well declare pointers evil and taboo, since they cause a far greater amount of damage when the programmer using them doesn't know what she's doing. >> The point is that you can run into the same problem ("out of memory") >> with >> static memory allocation. It's not a problem inherent to dynamic memory >> allocation. > > However, with static allocation you will be informed by the compiler or > the > linker that there is a problem -- and not when the customer is asking for > help. Say you allocate a static buffer to hold data that you receive over UART. What happens if the buffer is too small to hold the data? Your compiler has no idea how big your buffer needs to be, or whether it will overflow or not. Vitaliy -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist