From: Archie Cobbs (archie@whistle.com)
Date: Sun Oct 18 1998 - 19:11:59 EDT
Godmar Back writes:
> > Are you talking about the problem of objects that contain pointers
> > to non-object blocks of memory (such objects are necessarily used
> > by native code)?
>
> Yes.
>
> > If so, why not just create a byte[] array to hold the native-private data?
> > I'm not sure I know what I'm asking about however..
>
> Well, a byte[] array would be the clean way, but it would be unnecessary
> overhead in memory and access time (and require lots of rewriting, which
> I'm not inclined to do).
In general, this non-object memory would need to get garbage
collected along with the object itself, right? Having a byte[]
array lets this happen automatically with your precise gc.
Otherwise, won't every object that has such "private memory"
require a special finalizer to free it? Sounds ripe for potential
memory leaks.
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.
-Archie
___________________________________________________________________________
Archie Cobbs * Whistle Communications, Inc. * http://www.whistle.com
This archive was generated by hypermail 2b29 : Sat Sep 23 2000 - 19:57:00 EDT