#144722 - SteveH - Tue Nov 06, 2007 1:17 am
Ok this is going to sound crazy, but it's driving me nuts right now.
I'm trying to allocate some memory in my currect project by using malloc, but it's crashing on real HW.
The code I've got is simply:
where pbaseWindow is a pointer to a baseWindow struct. I can over come this I'm sure by using new - but I'm doing this in pure C - no classes, no fancy coding styles. I'm also having a strange issue with a switch statement, but the malloc is the most important one right now...
Any ideas on what's causing this? and that's the only malloc in the entire code base at the moment, if I comment out that one line, everything else works fine!!!
I'm trying to allocate some memory in my currect project by using malloc, but it's crashing on real HW.
The code I've got is simply:
Code: |
pbwNew = (pbaseWindow) malloc( sizeof( baseWindow ) ); |
where pbaseWindow is a pointer to a baseWindow struct. I can over come this I'm sure by using new - but I'm doing this in pure C - no classes, no fancy coding styles. I'm also having a strange issue with a switch statement, but the malloc is the most important one right now...
Any ideas on what's causing this? and that's the only malloc in the entire code base at the moment, if I comment out that one line, everything else works fine!!!