unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
* Latent bugs?
@ 2002-12-28  8:49 Marko Rauhamaa
  2002-12-28  9:30 ` Lynn Winebarger
  0 siblings, 1 reply; 4+ messages in thread
From: Marko Rauhamaa @ 2002-12-28  8:49 UTC (permalink / raw)



The Guile manual warns about "a Common Mistake in Allocating Smobs":

http://www.gnu.org/software/guile/docs/guile-ref/A-Common-Mistake-In-Allocating-Smobs.html#A%20Common%20Mistake%20In%20Allocating%20Smobs

Indeed, it seems to me the Guile 1.6.0 source code contains numerous
instances of this common mistake. For example (in scmsigs.c):

  return scm_list_2(scm_cons(scm_long2num(old_timer.it_interval.tv_sec),
                             scm_long2num(old_timer.it_interval.tv_usec)),
                    scm_cons(scm_long2num(old_timer.it_value.tv_sec),
                             scm_long2num(old_timer.it_value.tv_usec)));

If I understand it correctly, this statement contains several
allocations, each of which can potentially trigger garbage collection
and delete any of the intermediate results.

Have I mistaken? What is the right way of constructing and returning the
list above?


Marko

-- 
Marko Rauhamaa      mailto:marko@pacujo.net     http://pacujo.net/marko/


_______________________________________________
Bug-guile mailing list
Bug-guile@gnu.org
http://mail.gnu.org/mailman/listinfo/bug-guile


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2002-12-28 19:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-12-28  8:49 Latent bugs? Marko Rauhamaa
2002-12-28  9:30 ` Lynn Winebarger
2002-12-28 18:35   ` Marko Rauhamaa
2002-12-28 19:22     ` Marius Vollmer

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).