Does the macro take up memory? Or is a macro similar to a reference, just representing an alias of a constant and not allocating memory?

This problem actually needs to be divided into two parts:

Macros, as preprocessing commands, don't allocate memory. You understand them as "references" and "aliases" correctly.

Macros are processed at compile time, and there are no macros in the generated executable file, so macros do not occupy memory.

C programs are compiled by replacing macro names with strings. This process is called "macro expansion".

After "macro expansion", whether the content defined by the macro needs to be allocated memory depends on the result of macro replacement.

But this is not the memory occupied by macros.

So it's just "Does your macro take up memory?" The answer to this question is that there is no occupation.