Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Message

GCC - locals performance

2005-12-14 by xjag74

Hi,

I wonder which kind of implementation well be performed faster using 
GCC:

void functionname(void)
{
  unsigned char x=0;
  unsigned char y=1;
  unsigned char z=2;

  ...Do something with x,y and z.
}

or

void functionname(void)
{
  unsigned long x=0;
  unsigned long y=1;
  unsigned long z=2;

  ...Do something with x,y and z.
}


The first example uses less stack, but it takes a longer time for 
initialization when calling the function cause the 8 bit have to be 
masked out.
Am I right with that supposition?

regards
xjag

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.