guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Smobs & garbage collecting


From: Christian Mauduit
Subject: Re: Smobs & garbage collecting
Date: Sat, 31 Dec 2005 10:02:37 +0100
User-agent: Mozilla Thunderbird 1.0.7 (X11/20051019)

Han-Wen Nienhuys a écrit :
> In article <address@hidden>,
> Christian Mauduit  <address@hidden> wrote:
> 
>>The funny thing is that if I stop calling (display %my-smob) then all
>>the smobs are correctly freed when calling scm_gc().
> 
> 
> There was a memory leak in the display routines, which was recently
> fixed in the CVS branch.
Interesting! I will check that.

> FWIW, obsessively tracking frees and mallocs
> doesn't make much sense when you have GC. The nice thing of GC is that
> you can stop worrying about having to balance every malloc with
> exactly one free, and pass around SCM objects as much as you like,
> without headaches about ownership of objects.
I perfectly agree with that the advantage of GC is that it frees you of
the burden of calling free, which is just awesome. Point is some tasks
(in my program) still need to be done in standard C, and not scheme. I'm
talking about things like setting up low-level OpenGL arrays, dealing
with byte endianess in RGBA structures, powering algorithms which are
currently coded in assembly and benefit from it, and so on. Some tasks
do require standard C and/or assembly. It might only be 5% of the total
program, but they still exist. BTW it's one of the reason Guile exists
for: allow coders to do "some things in C" and "some things in Scheme".

Have a nice day,

Christian.

-- 
Christian Mauduit <address@hidden>     __/\__ ___
                                        \~/ ~/(`_ \   ___
http://www.ufoot.org/                   /_o _\   \ \_/ _ \_
http://www.ufoot.org/ufoot.pub (GnuPG)    \/      \___/ \__)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]