发明名称 |
Hardware-protected reference count-based memory management using weak references |
摘要 |
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. |
申请公布号 |
US8838656(B1) |
申请公布日期 |
2014.09.16 |
申请号 |
US201012804900 |
申请日期 |
2010.07.29 |
申请人 |
Hiscamp Systems, Inc. |
发明人 |
Cheriton David R. |
分类号 |
G06F17/30 |
主分类号 |
G06F17/30 |
代理机构 |
Van Pelt, Yi & James LLP |
代理人 |
Van Pelt, Yi & James LLP |
主权项 |
1. 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 back to the first object, wherein establishing the second reference includes:
determining whether the first reference from the first object to the second object is a strong reference; andin the event that the first reference from the first object to the second object is determined to be a strong reference, prohibiting the second reference from the second object back to the first object from being a strong reference and making the second reference a weak reference that does not increase the strong reference count of the first object; detecting, using one or more computer processors, that the strong reference count of the first object has reached zero; and in response to detecting that the strong reference count has reached zero, invoking a corresponding memory management-related action, wherein the corresponding memory management-related action is invoked at least in part by a hardware trap that is invoked in response to detecting that the strong reference count has reached zero. |
地址 |
Menlo Park CA US |