Optimization Topics/Exercise 02: Difference between revisions
From Wiki**3
No edit summary |
No edit summary |
||
| Line 10: | Line 10: | ||
return c; | return c; | ||
} | } | ||
</source> | </source> | ||
Latest revision as of 18:06, 14 May 2019
Considere a seguinte função em C:
- Que optimizações independentes da máquina são possíveis?
- Traduza-a para Postfix optimizado.
int *fun(int *a, int *b, int len) {
int *c = (int *)malloc(2 * 4), i;
for (i = 0; i < (len < 2 ? len : 2); i++)
c[i] = a[i] + b[i];
return c;
}