Path: utzoo!attcan!uunet!mcsun!hp4nl!star.cs.vu.nl!jos From: jos@cs.vu.nl (Jos Warmer) Newsgroups: comp.lang.eiffel Subject: Re: What happens when you're gone and forgotten? Message-ID: <6078@star.cs.vu.nl> Date: 22 Mar 90 08:30:21 GMT References: <1586@xyzzy.UUCP> <6025@star.cs.vu.nl> <1990Mar20.174709.6521@mentor.com> Sender: news@cs.vu.nl Lines: 26 plogan@mentor.com (Patrick Logan) writes: >In article <6025@star.cs.vu.nl> jos@cs.vu.nl (Jos Warmer) writes: > To get the behaviour you desire, inherit from class MEMORY and > redefine the `dispose' function. >Does Eiffel use this in the window system classes to protect X's C >allocated structures? I checked the window system classes and found no dispose function anywhere. So the answer is no. In my opinion this is shortcoming of the library classes. I think each class that allocates C structures should use the dispose function to deallocate this structures. Otherwise C data garbage will never be deallocated. >Where (else) does Eiffel use this? Is it always to deallocate C data? It can be used to deallocate C data, but also for other purposes. E.g: if an object is associated with a file, the dispose routine could close that file (to avoid too many opened files). You might also use it to trace the behaviour of the garbage collector for one or more classes. Jos Warmer jos@cs.vu.nl