|
|||||||||||
Technical Support Support Resources
Product Information |
C51: Mixing Reentrant Functions and Non-reentrant FunctionsInformation in this article applies to:
QUESTIONIs it possible to mix reentrant and non-reentrant functions in the same program? Can a non-reentrant function call a reentrant function which then calls another non-reentrant function? ANSWERYes. The compiler and linker keep track of all memory used by the non-reentrant functions and create a call tree that is correct. The overlaid memory will be maintained correctly. In the following example:
The main function calls f2, which calls r1 (which is reentrant), which calls f1 (which is not reentrant). The linker builds the following call tree for this example:
From this call tree, you can see that the memory used by the main function (?PR?MAIN?MAIN) at 0008h is exclusive of the memory used by the f2 function (?PR?F2?MAIN) at 000Ah and the f1 function (?PR?F1?MAIN) at 000Ch. SEE ALSO
Last Reviewed: Thursday, February 25, 2021 | ||||||||||
|
Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.