-
公开(公告)号:US20130111446A1
公开(公告)日:2013-05-02
申请号:US13719793
申请日:2012-12-19
Applicant: Apple Inc.
Inventor: Gerald Blaine Garst, JR. , William Bumgarner , Fariborz Jahanian , Christopher Arthur Lattner
IPC: G06F11/36
CPC classification number: G06F11/362 , G06F8/443 , G06F9/4484 , G06F12/023
Abstract: Methods, software media, compilers and programming techniques are described for creating copyable stack-based closures, such as a block, for languages which allocate automatic or local variables on a stack memory structure. In one exemplary method, a data structure of the block is first written to the stack memory structure, and this may be the automatic default operation, at run-time, for the block; then, a block copy instruction, added explicitly (in one embodiment) by a programmer during creation of the block, is executed to copy the block to a heap memory structure. The block includes a function pointer that references a function which uses data in the block.