Memory allocation issues on ARM boards

arm

Does using memory allocation API such calloc / malloc cause issues on ARM based boards ? I recently faced a issue wherein I used calloc (1024 Bytes) and this buffer was used across many functions in a single source file. I observed the output of a particular function varied randomly when calloc was used, but when I switched over to a fixed array, the issue never showed up. Hence I am wondering if calloc has got any limitations on a small memory footprint board.

Best Answer

Assuming you get no error return from the calloc/malloc, the odds are about 9999 to one on that you have a bug, either due to misuse of malloc, misuse of the space so allocated, incorrect memory sections/placement or just because the fixed and malloced buffers will have different addresses.