[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Latent bugs?
From: |
Marko Rauhamaa |
Subject: |
Latent bugs? |
Date: |
28 Dec 2002 00:49:39 -0800 |
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:address@hidden http://pacujo.net/marko/
- Latent bugs?,
Marko Rauhamaa <=