Patent ID: 9557917
Date: 2017-01-31
CPC Classifications: G06F

Claim:
1. A system for allocating memory, comprising: a processor; and a memory to store a compiler and one or more modules, the compiler being comprised of instructions that when executed by the processor, cause the processor to perform the following operations: determining whether a prototype of a callee function is within a scope of a caller, the caller being a module containing a function call to the callee function; when the prototype of the callee function is not within the scope of the module, inserting instructions in the caller to allocate a register save area in a memory; when the prototype of the callee function is within the scope of the caller, determining whether the function call includes one or more unnamed parameters; inserting instructions in the caller to allocate a register save area in a memory when it is determined that the function call includes one or more unnamed parameters; determining whether all parameters of the function can be passed in registers; and inserting instructions in the caller to allocate a parameter overflow area in the memory when all parameters of the function call cannot be passed in registers.