From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11437 invoked by alias); 12 May 2003 18:06:45 -0000 Mailing-List: contact guile-gtk-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: guile-gtk-owner@sources.redhat.com Received: (qmail 6391 invoked from network); 12 May 2003 17:59:47 -0000 Received: from unknown (HELO lumo.pacujo.net) (209.77.185.85) by sources.redhat.com with SMTP; 12 May 2003 17:59:47 -0000 Received: (from marko@localhost) by lumo.pacujo.net (8.11.6/8.11.6/SuSE Linux 0.5) id h4CHpWB28747; Mon, 12 May 2003 10:51:32 -0700 To: guile-gtk@sources.redhat.com Subject: Re: Added a bunch of GDK routines. References: <878ytd5ai8.fsf@zip.com.au> From: Marko Rauhamaa In-Reply-To: <878ytd5ai8.fsf@zip.com.au> User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1 Date: Mon, 12 May 2003 18:06:00 -0000 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2003-q2/txt/msg00059.txt.bz2 Kevin Ryde : > Marko Rauhamaa writes: > > - guile-gtk.[ch]: Made xmalloc and xrealloc non-static > > Might be prudent to rename them to sgtk_something. Might be. > I guess it might be nice to use scm_malloc to gc if out of memory, but > I'm not smart enough to know if that'd cause subtle problems. The current situation is not perfect since we are not telling the garbage collector of the "hidden" memory we are allocating. Even when we are not using scm_must_malloc, we should call scm_done_malloc with a positive argument during allocation and with a negative argument when we free memory to let GC have an idea of memory consumption (http://home.thezone.net/~gharvey/guile/gc/gc-mistakes_3.html). If we call scm_must_malloc (and we should), we scm_done_malloc is not necessary during allocation, but you still have to call it with a negative size at freeing time. Finally, the GTK, GDK and Xlib routines also allocate memory, and ideally we'd like to be able to report it to guile's GC. The 'size option is already there (albeit currently unused) to report the size to build-guile-gtk-1.2. The only "subtlety" I'm aware of is smobs that are not yet tied to other smobs. They might accidentally get wiped out during GC. Marko -- Marko Rauhamaa mailto:marko@pacujo.net http://pacujo.net/marko/