reference counting

Reference counting is the form of garbage collection used in Babel. Each object keeps a ``reference count.'' When that count reaches zero, the object is destroyed and the memory reclaimed. In some languages teh counting is handled automatically, in some, like C, the developer must explicitly add and subtract from the reference count. (Using the functions addRef and deleteRef.) The internal implementation of deleteRef literally has an if statement that says ``If the count is 0, free this memory,'' so if the reference count of an object goes below one, all references to the object are immediately invalid.





babel-1.4.0
users_guide Last Modified 2008-10-16

http://www.llnl.gov/CASC/components
components@llnl.gov