Pregunta de entrevista de Aptiv

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

Respuesta de la entrevista

Anónimo

17 feb 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