Patent ID: 8051267

Claim:
A method for using versioned pointers to facilitate reuse of memory without garbage collection, comprising: receiving a request to allocate an object; obtaining the object from a pool of free objects, wherein the object includes a version number for the current allocation of the object, and wherein each object in the pool of free objects is indicated by a corresponding pointer; setting an allocated/free flag within the object to indicate that the object is allocated; encoding the version number for the current allocation of the object into the pointer to the object; returning the pointer to the object, which includes the encoded version number, whereby one or more subsequent accesses to the object through the pointer compare the version number encoded in the pointer with the version number within the object to determine whether the object has been referenced erroneously; in response to receiving a request to perform a garbage collection of the pool of free objects, for each free object in the pool of free objects: comparing an encoded version number in the free object's pointer with a version number within the free object; and if the encoded version number in the free object's pointer and the version number within the free object match, setting the encoded version number in the free object's pointer to zero.