I’m having an allocation problem in a C application
When debugging, I see that the problem occurs in this line:
long **matr=(long **)calloc(my_size, sizeof(long *));
Usually, my_size is less than 1000, and the error doesn’t occur.
But there’s one case where it is around 2000, and the error occurs.
The output window shows this:
First-chance exception at 0x77cb79ce in myprogram.exe: 0xC0000005: Access violation reading location 0x31322d50.
What should I do to avoid this problem?
It’s a very old program. I’d like to avoid changing this line, that is called in a lot of parts.
But I hope there is something that I could do before this
When I open then Memory window, on Debug options on VS, this address shows “??”
Seems that this is an invalid memory address, but it doesn’t seem that I’m trying to allocate a huge amount of memory. The memory usage is not achieving 50%, and the application is not using more than 300MB