2017-01-18 04:28 PM
The Keil uVision IDE/compiler chain has a `&sharppragma` for preventing heap usage; see
http://www.keil.com/support/man/docs/armlib/armlib_chr1358938927854.htm
. The great thing about this is that the linker fails if anyone (or a library) attempts to use the heap. I've searched through the IAR documentation and haven't seen an equivalent method of preventing inadvertent heap usage. I've looked at the linker options as well. Is there a way to prevent compiling/linking if a routine tries to use the heap with the IAR toolchain?#iar #heap2017-06-23 07:25 PM
From an FAE at IAR:
Options:
1. Rewriting the malloc() and free() functions in the library to generate ERROR message every time it used.
2. Redirecting these functions to other functions that will do nothing or generate errors by using command line options like “ –redirect malloc=nomalloc�? and your nomalloc() will be used every time that someone uses malloc(). 3. Creating a function using prototype. The following link describes all three ways:/external-link.jspa?url=https%3A%2F%2Fwww.iar.com%2Fsupport%2Fresources%2Farticles%2Foverriding-and-redirecting-library-modules%2F