A program conversion apparatus for converting a source program to an executable program, the source program including a first descriptor indicating dynamic memory allocation for a specified object, a second descriptor indicating that allocated memory is to be freed, a third descriptor indicating (1) repetition of instructions within a specified small block, and (2) a number of repetitions, and a fourth descriptor indicating memory allocation for a specified plurality of objects only when instructions are executed within a specified large block that includes the specified small block, the program conversion apparatus comprising:
- a specifying means for specifying a lifetime of allocated memory, by referring to positions in the source program of (A) the first descriptor and (B) reference descriptors indicating references to memory allocated by the first descriptor;
- a determining means for determining whether the specified lifetime is confined within the specified large block and whether the position of the first descriptor is within the specified small block;
- a detecting means for detecting the number of repetitions for the third descriptor corresponding to the specified small block;
- and
- a generating means for generating an instruction in the executable program when (i) the specified lifetime is determined to be confined within the specified large block and (ii) the position of the first descriptor is determined to be within the specified small block, so that memory, determined by repeating the allocation of memory that is (a) allocated by the first descriptor and (b) freed by the second descriptor, for the number of repetitions shown by the third descriptor, is indicated as being allocated by the fourth descriptor, the fourth descriptor being positioned within the specified large block but outside the specified small block.