[kaffe] gc_free vs. KFREE
Dalibor Topic
robilad at yahoo.com
Wed Apr 2 06:04:02 PST 2003
--- Marc Kleine-Budde <kleine-budde at gmx.de> wrote:
> On Mon, Mar 31, 2003 at 08:29:43AM -0800, Dalibor
> Topic wrote:
> > Hi Marc,
> >
> > --- Marc Kleine-Budde <kleine-budde at gmx.de> wrote:
> > >
> > > My assumption is that KFREE clears the mem at
> once,
> > > and gc_free marks
> > > the mem to be freed by the garbage collector?
> Am I
> > > right?
> >
> > AFAIK, KMALLOC/KFREE should be used for memory
> that
> > does not go through the gc, while
> gc_malloc/gc_free
> > should be used for the rest. Never mix the calls,
> or
> > you'll be in big trouble. KMALLOC/KFREE leave
> memory
> > management to the runtime library, while
> > gc_malloc/gc_free do their own memory management.
>
> Okay. Remeber never mix gc_* and K* calls. But if
> you have a look at the
> CVS-sources $KAFFE/libraries/clib/native/ZipFile.c
> lines 26-36. The mem
> for the str is alloced via KMALLOC, but later freed
> with gc_free. It
> this a bug?
Yeah, I think so. I've attached a patch to fix it,
(and a similar case below). could you give it a try,
and see if it breaks anything?
cheers,
dalibor topic
__________________________________________________
Do you Yahoo!?
Yahoo! Tax Center - File online, calculators, forms, and more
http://tax.yahoo.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: zip-file.patch
Type: application/octet-stream
Size: 681 bytes
Desc: zip-file.patch
Url : http://kaffe.org/pipermail/kaffe/attachments/20030402/089aff1c/attachment-0003.obj
More information about the kaffe
mailing list