not used functions linked and declares XDATA for local vars

Hello,

I have detected that some functions like this one are using their own XDATA space instead of using the XDATA_GROUP for local purposes:

for example this one:

void zmemcpy2(UINT8 *dst,const UINT8 *src, UINT32 len)
{

      --dst;   --src;
       while (len--)
       {
          *(++dst) = *(++src);
   }
}

then this is the line in the m51 file:

XDATA   82C2H     000AH     UNIT         ?XD?_ZMEMCPY2?LIB


so then Im wasting ten bytes of global data space for just a memcopy. Why is this happening?

And here it is another weird thing: this function is never used by the rest of the program. It is compiled, but should not be linked.
any idea?

thanks in advance...

Parents
  • Hmm... what happened there?
    The text was all still there when I hit my 'Back' button.

    So, let's just try that again:

    "About using our own memcopy2, its possible to write more efficient and smaller functions."

    Maybe it is possible - but have you checked whether what you've shown is actually any more efficent than Keil's?

    If you're going for absolute efficiency, wouldn't you want to avoid generic pointers...?

Reply
  • Hmm... what happened there?
    The text was all still there when I hit my 'Back' button.

    So, let's just try that again:

    "About using our own memcopy2, its possible to write more efficient and smaller functions."

    Maybe it is possible - but have you checked whether what you've shown is actually any more efficent than Keil's?

    If you're going for absolute efficiency, wouldn't you want to avoid generic pointers...?

Children
More questions in this forum