主权项 |
1. A method for reclaiming memory in a computing device, comprising:
storing, on the computing device, a first pointer pointing to a first memory location storing the beginning of a data structure, wherein a plurality of threads executing on the computing device may concurrently access the data structure; storing, on the computing device, a second pointer; performing an operation on the data structure, wherein the operation changes a location of the beginning of the data structure from the first memory location to a second memory location; updating the second pointer to point to the second memory location; determining whether memory allocated to the data structure may be reclaimed; and reclaiming memory allocated to the data structure, including memory located at the first memory location pointed to by the first pointer, in response to determining that memory allocated to the data structure may be reclaimed. |