1. A method comprising: receiving, by a processing device executing a compiler, source code of a function associated with a first compiler prompt, wherein the function comprises at least one variable to be allocated in a memory space on a stack; determining, by the compiler, that the first compiler prompt indicates to retain at least a portion of the allocated memory space on the stack after execution of the function; and compiling, by the compiler in view of the first compiler prompt, the source code to generate a prologue function and an epilogue function associated with the execution of the function, wherein the prologue function is to allocate the memory space for the function, and wherein at least one of the prologue function or the epilogue function is to cause to retain the at least a portion of the allocated memory space on the stack after the execution of the function.