1. A machine readable non-transitory storage medium storing executable program instructions which when executed by a data processing system cause the data processing system to perform a method comprising: executing software written in a language which uses a stack memory allocation technique to store local or automatic variables, the software configured to: write a data structure of a block to a stack memory structure before executing block copy instructions, the block including a function pointer that references a function which uses data in the block; execute block copy instructions, caused to be invoked in the writing of the software, to copy the block from the stack memory structure to a heap memory structure which is configured to store global variables, and wherein a variable referred to in the block is copied from the stack memory structure to the heap memory structure and a pointer for the variable referred to in the block is changed to point to the variable copied to the heap memory structure instead of the stack memory structure.