Patent ID: 8738578

Claim:
One or more non-transitory computer-readable storage media storing instructions, the instructions comprising: one or more instructions that, when executed by a processor, cause the processor to: obtain program code that implements a data structure, the data structure being implemented during an execution of the program code, a size of the data structure being equal to a quantity of first elements included in the data structure, and the data structure being in a first state based on the size of the data structure being equal to the quantity of the first elements; execute, during the execution of the program code, a first portion of the program code, executing the first portion of the program code requiring one or more second elements to be added to the data structure; determine, based on the data structure being in the first state, that first criteria, for determining whether to increase the size of the data structure, are met; calculate, based on the first criteria being met, a new size of the data structure based on at least one or more of: an algorithm, a curve, a total quantity of the first elements and the one or more second elements, an amount of available memory, or architecture information corresponding to the processor, the new size of the data structure being greater than the total quantity of the first elements and the one or more second elements; allocate an area, in a memory, for storing the data structure based on the new size; add the one or more second elements to the data structure by storing the first elements and the one or more second elements in the area, the data structure being in a second state based on the new size of the data structure being greater than the total quantity of the first elements and the one or more second elements; execute, during the execution of the program code, a second portion of the program code, executing the second portion of the program code requiring one or more third elements to be added to the data structure; determine, based on the data structure being in the second state, that second criteria, for determining whether to increase the new size of the data structure, are not met; and add the one or more third elements to the data structure by storing the one or more third elements in the area.