Hardware-protected reference count-based memory management using weak references
AssigneeIntel Corporation
InventorDavid R. Cheriton
Life of this patent
Estimating the term…
Abstract
A method for managing memory, comprising: maintaining a strong reference count for a first object; establishing a first reference from the first object to a second object; establishing a second reference from the second object to the first object, wherein the second reference is a weak reference that does not increase the strong reference count of the first object; detecting that the strong reference count of the first object has reached zero; in response to detecting that the strong reference count has reached zero, invoking a corresponding action.
Claims17
An apparatus comprising:
- a memory to store a plurality of data objects, wherein a first data object, of the plurality of data objects, is to reference at least a second data object, of the plurality of data objects, and the second data object is to reference at least the first data object;
- and
- a processor in communication with the memory, the processor is to automatically deallocate the first data object from the memory when a reference count of a particular type of reference, from among different types of hardware-protected references, to the first data object becomes a null value, and, prior to the deallocation, to remove the reference to the first data object by the second data object from the memory;
- wherein the different types of hardware-protected references includes a strong hardware-protected reference and a weak hardware-protected reference.
A computerized method comprising:
- identifying a count of strong hardware-protected references to a first data object, of a plurality of data objects, by one or more of the plurality of data objects that includes at least a second data object, and wherein the first data object references the second data object;
- changing by the one or more of the plurality of data objects of strong hardware-protected references to the first data object;
- detecting, by a processor, when the count of strong hardware-protected references to the first data object is changed to a null value;
- in response to detecting the count of the strong hardware-protected references to the first data object changed to the null value, performing an operation to preserve the first data object in a memory or performing an operation on the second data object prior to deallocation of the first data object from the memory;
- and
- in response to detection of the null value, incrementing the count of strong hardware-protected references to the first data object to preserve the first data object from deallocation.
One or more computer-readable storage medium including a plurality of instructions to cause an apparatus, in response to execution by one or more processors of the apparatus, to:
- maintain a plurality of data objects in a memory, wherein a first data object, of the plurality of data objects, is to reference at least a second data object, of the plurality of data objects, and the second data object is to reference at least the first data object;
- automatically deallocate the first data object from the memory when a reference count of a particular type of reference, from among different types of hardware-protected references, to the first data object becomes a null value, wherein, prior to deallocation, removing the reference to the first data object by the second data object from the memory, and wherein the particular type of reference precludes a weak hardware-protected reference;
- wherein the different types of hardware-protected references includes a strong hardware-protected reference and the weak hardware-protected reference.
Dependencies are inferred from the claim text.