public inbox for guile-gtk@sourceware.org
 help / color / mirror / Atom feed
From: Marko Rauhamaa <marko@pacujo.net>
To: guile-gtk@sources.redhat.com
Subject: Re: Added a bunch of GDK routines.
Date: Mon, 12 May 2003 18:06:00 -0000	[thread overview]
Message-ID: <m3u1c0m4t7.fsf@lumo.pacujo.net> (raw)
In-Reply-To: <878ytd5ai8.fsf@zip.com.au>

Kevin Ryde <user42@zip.com.au>:

> Marko Rauhamaa <marko@pacujo.net> 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/

  reply	other threads:[~2003-05-12 18:06 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-05-02  1:25 Marko Rauhamaa
2003-05-11 23:28 ` Kevin Ryde
2003-05-12 18:06   ` Marko Rauhamaa [this message]
2003-05-12 18:56     ` Marko Rauhamaa
2003-06-06 22:23 ` GdkWChar (was: Added a bunch of GDK routines.) Kevin Ryde
2003-06-14 23:58 ` gdk-gc-copy comments " Kevin Ryde
2003-06-20 23:54 ` sgtk_timestamp returns " Kevin Ryde

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3u1c0m4t7.fsf@lumo.pacujo.net \
    --to=marko@pacujo.net \
    --cc=guile-gtk@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).