Pergunta de entrevista da empresa Aptiv

How macros and functions in embedded C affect memory? which one is occupy more memory?

Resposta da entrevista

Sigiloso

17 de fev. de 2020

function calls consume from the stack memory as it is executed. while macros are handled in the preprocessor replacing every macro by the section of code defined by this macro . this can lead to very large code size which is not allowed in an embedded system which has limited memory.

1