From: Tim Wilkinson (tim@transvirtual.com)
Date: Mon Oct 19 1998 - 13:32:40 EDT
kaffe.util.Ptr is used to reference bits of memory allocated by native
libraries or the underlying system which don't conform to the standard Object
model and must be explicitly managed - there are plenty of examples with the X
lib, the zlib and others.
A 'safe' way to do this might be to encapulate these pointers in another final
class with a finalzier which will always be called then the pointer should be
freed - but this extra level of indirection is a bit of a hassel.
Cheers
Tim
Archie Cobbs wrote:
> Godmar Back writes:
> > > It may actually be easier to use byte[] than to add finalizers to
> > > all these objects, not to mention that using byte[] carries no
> > > maintenance penalty, whereas remembering to free private memory
> > > does.
> > >
> > > When you're talking about embedded systems, a slightly slower system
> > > with no memory leaks is vastly preferable to the reverse.
> >
> > In most cases, you need special destructors anyway because the
> > object referred to is something "special" that requires an explicit
> > free operation, be it jthread_destroy or XWindowDestroy or whatever.
>
> Hmm.. OK, but when there's some nasty memory leak that no one can
> find because of this, I'll be the first to say 'I told you so' :-)
>
> > That reminds me: do we free the backtraces if a throwable is gc'ed?
> > I have to check that.
>
> A perfect example. 1/2 :-)
>
> -Archie
>
> ___________________________________________________________________________
> Archie Cobbs * Whistle Communications, Inc. * http://www.whistle.com
-- Tim Wilkinson Tel: +1 510 704 1660 Transvirtual Technologies, Inc., Fax: +1 510 704 1893 Berkeley, CA, USA. Email: tim@transvirtual.com
This archive was generated by hypermail 2b29 : Sat Sep 23 2000 - 19:57:00 EDT