This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

access violation to reserved memory

Hi every one
I encounter with this error during debugging my program in Keil:

*** error 65: access violation at 0x0FFE443C : no 'write' permission

I am using LPC1768. this area that compiler effort to access is reserved in LPC1768 Memory Map.

My program is using dynamic sized variables and I also changed heap and stack size in

Startup; but there were the same errors

Why this kind of error occurs? Can every one help me?

Parents
  • A float would require 4 bytes. A double - for a compiler that supports the double data type and doesn't downgrade it to a float - would require at least 8 bytes. So an array of 5800 double would be at least 46400 bytes. That's twice your heap size.

    Why are you experimenting? The compiler can tell you the required size of the array with the operator sizeof. And malloc() would not return a real pointer value if the heap is too small so the allocation fails. Any call to malloc() or calloc() should verify the returned value.

    So how can you not know if the program is able to perform all required heap allocations?

Reply
  • A float would require 4 bytes. A double - for a compiler that supports the double data type and doesn't downgrade it to a float - would require at least 8 bytes. So an array of 5800 double would be at least 46400 bytes. That's twice your heap size.

    Why are you experimenting? The compiler can tell you the required size of the array with the operator sizeof. And malloc() would not return a real pointer value if the heap is too small so the allocation fails. Any call to malloc() or calloc() should verify the returned value.

    So how can you not know if the program is able to perform all required heap allocations?

Children