??? 08/22/09 18:44 Read: times |
#168475 - More way than one to create memory leaks Responding to: ???'s previous message |
Richard Erlacher said:
HLL's can, but don't necessarily, generate memory leaks because they use dynamic memory allocation That has nothing to do with the language: if you write your 'C' programs without using dynamic allocation, you won't get leaks - again, you must compare like with like. Not really true. There are more leaks than calling malloc() and failing to call free(). Any function call that returns a handle (to a possibly statically allocated resource) will consume a resource, that may be leaked. Anything that has a file system and uses temporary files can create leaks that may even accumulate despite a cold start of the device. But a tool for statically analys of code can look for a lot more errors. This may include: - Code that disables interrupts and potentially don't enable interrupts again. - Code that locks a resource and potentially doesn't unlock the resource. |