[Ecls-list] Automatic memory reclamation
Juan Jose Garcia-Ripoll
juanjose.garciaripoll at gmail.com
Thu Dec 13 20:11:02 UTC 2012
On Thu, Dec 13, 2012 at 7:50 PM, Peter Enerccio <enerccio at gmail.com> wrote:
> Is it possible for automatic memory reclamation when object is no longer
> needed (ie it's parent foreign type has been disposed in the ecl memory)?
>
This is called finalization and it happens automatically for all lisp
objects
> Or the same equivalent for defclass made class instance.
>
They are automatically garbage collected.
> The reason being, in sdl, you must call SDL_FreeSurface when it's no
> longer needed and it would be appropriate to call it when object holding
> the reference to it (or class holding the reference to the object) is being
> disposed by the system.
>
You have to associate a function with the object you want to clean up
before garbage collection: http://ecls.sourceforge.net/new-manual/ch28.html
Beware that this is expensive.
Juanjo
--
Instituto de Física Fundamental, CSIC
c/ Serrano, 113b, Madrid 28006 (Spain)
http://juanjose.garciaripoll.googlepages.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/ecl-devel/attachments/20121213/bafddb3a/attachment.html>
More information about the ecl-devel
mailing list