| ??? 03/21/01 23:59 Read: times |
#10256 - RE: Keil Memory Overlay Best Way to? |
Hi Peter and Andy N.
I understand that overlay is not the same as reentrant. Functions that are REENTRANT uses the model's stack to store local variables so no overlay will be done on such functions. To NOT use overlay comes with a very big penalty since as I understand it the compiler will then use unique memory locations for local variables. Imaging if you have hundreds of calling trees in your program. What works better (in my opinion) is to have an ALL_REENTRANT option so that all local variables and parameters use the stack by default and you can also use overlay as an option. This will make best use of the stack and also makes manually overlaying function pointers calls unneccessary. I don't know how much of a speed penalty I'm paying when using REENTRANT function calls (anybody knows?), but if the penalty is big, then having an ALL_REENTRANT option might not be a good idea then. :-) My project has the potential of using many service routines (more than 20) so using a switch statement is not good. Andy N., I'm sorry I'm quite sure what you mean by not calling the top function from the table. As far as the top of tree goes, can the compiler find out where the top of the tree is in the following example? static void Func(void) REENTRANT ; static void Worker(void); void (*fn)(void) REENTRANT = Func; static void Func(void) REENTRANT { int i; } static void Worker(void) { int i; } void main(void) { fn(); } Notice that Worker is not REENTRANT so the linker will overlay it, but the linker can only see Func() calls Worker and it cannot see that main calls Func() first. I still have to manually overlay the Worker() call. Am I wrong? Andy |
| Topic | Author | Date |
| Keil Memory Overlay Best Way to? | 01/01/70 00:00 | |
| RE: Keil Memory Overlay Best Way to? | 01/01/70 00:00 | |
| RE: Keil Memory Overlay Best Way to? | 01/01/70 00:00 | |
| RE: Keil Memory Overlay Best Way to? | 01/01/70 00:00 | |
| RE: Keil Memory Overlay Best Way to? | 01/01/70 00:00 | |
| RE: Keil Memory Overlay Best Way to? | 01/01/70 00:00 | |
| RE: Keil Memory Overlay Best Way to? | 01/01/70 00:00 | |
| Correction to my above post | 01/01/70 00:00 | |
RE: Keil Memory Overlay Best Way to? | 01/01/70 00:00 |



