The active deallocation of objects in object‐oriented systems
Abstract
In object‐oriented systems, it is oftern useful for objects to be allowed to carry out some action before they are deallocated. This can be done by defining a destroy method in the object's class, and arranging for the memory system to send a message invoking this method immediately before deallocating the object. This allows resources associated with the object to be returned to the system, limited cross‐language garbage collection, and other, more complex, behaviour. During the execution of the destroy method it is possible for new references to objects to be created. Care must be taken that the garbage collection does not erroneously free such objects. Algorithms are presented to implement destroy methods in systems using reference counting and mark‐scan garbage collection techniques. Properties that are desirable in such systems are also discussed. Copyright © 1988 John Wiley & Sons, Ltd