OdeeanRDeathshead
30th March 2007, 02:02 PM
I have a problem.
I make use of malloc or new in many places to store data in. I normally have no problem but there seems to be a limit on how much I can use it. I always free/delete as soon as I no longer need the memory and always check for 0 returned. I have mechanisms in place in case of 0 but when malloc actually fails it dose not return. Malloc just never returns and hence crashes my program. What could be the cause of this?
+The actual memory I am requesting is ~2-20k, the available memory is 20-30mb.
I am considering creating a heap, using it to allocate blocks from and destroying it to clean the memory. This is a time consuming change, dose anybody have some experience with this problem?
The annoying part is that the code works 100% on old devices and fails on new ones. I never thought i would be rewriting this code.
I make use of malloc or new in many places to store data in. I normally have no problem but there seems to be a limit on how much I can use it. I always free/delete as soon as I no longer need the memory and always check for 0 returned. I have mechanisms in place in case of 0 but when malloc actually fails it dose not return. Malloc just never returns and hence crashes my program. What could be the cause of this?
+The actual memory I am requesting is ~2-20k, the available memory is 20-30mb.
I am considering creating a heap, using it to allocate blocks from and destroying it to clean the memory. This is a time consuming change, dose anybody have some experience with this problem?
The annoying part is that the code works 100% on old devices and fails on new ones. I never thought i would be rewriting this code.