| ||||||||
Technical Support Support Resources Product Information | BL51: AVOIDING FUNCTION POINTER PROBLEMS WITH NOOVERLAYInformation in this article applies to:
QUESTIONI read Application Note 129 dealing with function pointers and have a question that is not explicitly answered within the app note. All of the problems that are associated with function pointers seem to do with the data overlaying techniques used by the linker and the way arguments are passed. The app note states several times that the overlay directive may be used to "fix" the call tree that may not be correct when function pointers are used. If we use the NOOVERLAY directive, will all of these problems go away? We are using the large memory model and have a relative overabundance of RAM. With RAM usage being a non-issue for us, and function pointers being of great importance, we are inclined to use the NOOVERLAY directive. We ran several test that indicate that this will work, but would like confirmation that there are not other side effects to disabling data overlaying. ANSWERThere are no side effects from using NOOVERLAY and this will take care of the call tree analysis problem. However, accessing variables in xdata is around 7 times slower than accessing variables in data memory. In addition, using the large memory model increases the size of your code and slows down execution. So the ideal solution is to use the small memory model, locate specific variables in xdata and fix the call tree for your indirect function calls. MORE INFORMATION
SEE ALSO
FORUM THREADSThe following Discussion Forum threads may provide information related to this topic. Last Reviewed: Friday, July 15, 2005 | |||||||
| ||||||||