??? 08/22/09 17:31 Read: times |
#168473 - Yeah, you can do that ... but it's not recommended Responding to: ???'s previous message |
Andy Neil said:
Richard Erlacher said:
I've never encountered a memory leak in my ASM programming Presumably because you don't do dynamic allocation in ASM?! More likely in ASM is the classic "popping more than you pushed" problem... True enough, but that's not the classic memory leak problem, though on a scale such as found on 805x MCU's, with at most 128 bytes of iRAM for stack it could be a problem. It's easily found, though. The thing HLL's allow is grabbing dynamically allocated RAM form the common pool and forgetting to return it. 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. Of course, 'C' will never "pop more than it pushed" Yes, but it could pop or push more than you've got, if you're not just as careful as you'd have to be in ASM. Of course, some HLL's will slap your wrist if you do that. RE |