主权项 |
1. A method for creating an enhanced array comprising:
generating, by an enhanced compiler, an instrumented class file for an enhanced array class, wherein the enhanced array class comprises at least one element class; loading, by an enhanced runtime, the instrumented class file, wherein the instrumented class file corresponds to the enhanced array class; loading, by the enhanced runtime, a class file corresponding to the at least one element class of the enhanced array class; building, by the enhanced runtime, an internal data structure corresponding to the enhanced array class, wherein each element of the internal data structure corresponds to an instance of the element class of the enhanced array class; calculating, by the enhanced runtime, an amount of memory storage required to store an instance of the enhanced array class, wherein calculating the amount of memory storage required to store the enhanced array comprises:
multiplying a size of the data element of the enhanced array by a number of data elements to be stored in the enhanced array;adding a total size of metadata; andadding an amount of additional storage as required by the runtime; and allocating, by the enhanced runtime, the calculated amount of memory storage required to store the instance of the enhanced array class. |