程序优化小技巧

byte array1[4] = {1,2,3,4};
byte array2[4];
int i;

for(i = 0; i < 4; i++) array2[i] = array1[i];

------------------------------------------------------

DECLARE_ALIGNED_4(byte array1[4] = {1,2,3,4});
DECLARE_ALIGNED_4(byte array2[4]);
*(uint32_t*)array2 = *(uint32_t*)array1;

你可能感兴趣的:(程序优化小技巧)