Premium
The active deallocation of objects in object‐oriented systems
Author(s) -
Atkins Martin C.,
Nackman Lee R.
Publication year - 1988
Publication title -
software: practice and experience
Language(s) - English
Resource type - Journals
SCImago Journal Rank - 0.437
H-Index - 70
eISSN - 1097-024X
pISSN - 0038-0644
DOI - 10.1002/spe.4380181106
Subject(s) - garbage collection , computer science , object (grammar) , garbage , class (philosophy) , programming language , artificial intelligence
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.