摘要 |
In response to a memory allocation request received from an application thread, a random number is obtained (e.g., from a random number list previously populated with multiple random numbers). A starting location in at least a portion of a bitmap associated with a region including multiple blocks of the memory is determined based on the random number. A portion of the bitmap is scanned, beginning at the starting location, to identify a location in the bitmap corresponding to an available block of the multiple blocks, and an indication of this available block is returned to the application thread. |
主权项 |
1. A method in a system, the method comprising:
receiving, from an application thread, a request for memory to be allocated to the application thread, including an index value; obtaining a random number, the obtaining based on the received index value; determining, based on the random number, a starting location in at least a portion of a bitmap associated with a region including multiple blocks of the memory; scanning, beginning at the starting location, at least the portion of the bitmap to identify a location in the bitmap corresponding to an available block of the multiple blocks; and returning, to the application thread, an indication of the available block. |