Patent ID: 9747088
Date: 2017-08-29
CPC Classifications: G06F

Claim:
1. A method for enabling automatic reference counting, said method comprising: searching a source code for a particular pattern via a compiler associated with a computer system, wherein said source code is written in an existing language and wherein said particular pattern is for a reference associating an object with a portion of memory; recognizing a location of said particular pattern in said source code at said computer system; replacing said particular pattern with an automatic reference counting implementation by said compiler at said computer system without requiring a developer to develop structures for said automatic reference counting specific to said existing language, such that said source code executes an object destructor on demand irrespective of whether there are live references to said object, wherein said object destructor marks said object as disposed without freeing said portion of memory associated with said object and without impacting validity of said reference to said object; and executing said source code with said automatic reference counting implementation, wherein said automatic reference counting collects a reference and removes said reference from being a live reference, and wherein marking of said object as disposed by said object destructor is executed on demand based on said source code irrespective of whether there are live references to said object and without impacting validity of said reference to said object.