Patent ID: 9552158
Date: 2017-01-24
CPC Classifications: G06F

Claim:
1. A computer-implemented method for allocating memory, comprising: 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 the register save area in the 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.