unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* port initialization?
@ 2002-08-04 14:42 Han-Wen
  2002-08-08 17:33 ` Marius Vollmer
  0 siblings, 1 reply; 20+ messages in thread
From: Han-Wen @ 2002-08-04 14:42 UTC (permalink / 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


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

end of thread, other threads:[~2002-08-17  0:21 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-08-04 14:42 port initialization? Han-Wen
2002-08-08 17:33 ` 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

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