From: Han-Wen <hanwen@cs.uu.nl>
Subject: port initialization?
Date: Sun, 4 Aug 2002 16:42:52 +0200 [thread overview]
Message-ID: <15693.15724.416839.636665@blauw.xs4all.nl> (raw)
Just looking at some weird valgrind error here, ...
what about
z = scm_cell (scm_tc16_strport, 0);
SCM_DEFER_INTS;
pt = scm_add_to_port_table (z);
SCM_SET_CELL_TYPE (z, scm_tc16_strport | modes);
SCM_SETPTAB_ENTRY (z, pt);
SCM_SETSTREAM (z, SCM_UNPACK (str));
This looks like fishy code to me. When scm_add_to_port_table triggers
GC then it will see the (scm_tc16_strport, 0) cell, which is (or
should be) invalid.
Why not
scm_t_port *
scm_add_to_port_table ()
{
scm_t_port *p = gc_malloc( sizeof (scm_t_port));
p->port = SCM_EOL;
...
}
{
scm_t_port *newport = scm_add_to_port_table ();
SCM port = scm_cell (scm_tc16_port, newport);
newport->port = port;
..
}
Comments?
--
Han-Wen Nienhuys | hanwen@cs.uu.nl | http://www.cs.uu.nl/~hanwen
_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel
next reply other threads:[~2002-08-04 14:42 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-08-04 14:42 Han-Wen [this message]
2002-08-08 17:33 ` port initialization? Marius Vollmer
2002-08-08 19:35 ` Han-Wen Nienhuys
2002-08-08 20:31 ` Marius Vollmer
2002-08-08 20:54 ` Han-Wen Nienhuys
2002-08-08 21:14 ` Marius Vollmer
2002-08-08 23:17 ` Han-Wen Nienhuys
2002-08-10 13:30 ` Marius Vollmer
2002-08-16 22:06 ` Han-Wen Nienhuys
2002-08-17 0:21 ` Marius Vollmer
2002-08-08 23:20 ` Lynn Winebarger
2002-08-09 8:06 ` Han-Wen Nienhuys
2002-08-10 13:33 ` Marius Vollmer
2002-08-10 14:12 ` Lynn Winebarger
2002-08-11 15:57 ` Marius Vollmer
2002-08-08 19:37 ` Han-Wen Nienhuys
2002-08-08 20:32 ` Marius Vollmer
2002-08-08 23:07 ` Han-Wen Nienhuys
2002-08-10 13:09 ` Marius Vollmer
2002-08-16 22:06 ` Han-Wen Nienhuys
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
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=15693.15724.416839.636665@blauw.xs4all.nl \
--to=hanwen@cs.uu.nl \
/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).