summaryrefslogtreecommitdiff
path: root/libguile/vports.c
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2016-04-03 11:39:21 +0200
committerAndy Wingo <wingo@pobox.com>2016-04-04 16:30:56 +0200
commit67b147fb7a5e8771b0314fcc0fcc826db09d9949 (patch)
tree16fb15deb0f53abbd4dfc8e511a4443aba775a66 /libguile/vports.c
parent4460f1f15280e3378633115fe9035448a68c636b (diff)
downloadguile-67b147fb7a5e8771b0314fcc0fcc826db09d9949.tar.gz
Remove port free functions; just close instead
* libguile/ports.h (scm_t_port_type_flags): Replace SCM_PORT_TYPE_HAS_FLUSH with SCM_PORT_TYPE_NEEDS_CLOSE_ON_GC. (scm_t_ptob_descriptor): Remove free function. * libguile/ports.c (scm_set_port_needs_close_on_gc): New function. (scm_set_port_flush): Don't set flags. (scm_c_make_port_with_encoding, scm_close_port): Use the new flag to determine when to add a finalizer and also when to include the port in the weak set. (scm_set_port_free): Remove. (do_close, finalize_port): Close port instead of calling free function. * libguile/r6rs-ports.c (initialize_transcoded_ports): * libguile/vports.c (scm_make_sfptob): * libguile/fports.c (scm_make_fptob): Mark these ports as needing close on GC. * libguile/fports.c (fport_free): Remove. * NEWS: Update. * doc/ref/api-io.texi (Port Implementation): Update.
Diffstat (limited to 'libguile/vports.c')
-rw-r--r--libguile/vports.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/libguile/vports.c b/libguile/vports.c
index 17eac8695..c08df2ed0 100644
--- a/libguile/vports.c
+++ b/libguile/vports.c
@@ -225,6 +225,7 @@ scm_make_sfptob ()
scm_set_port_flush (tc, sf_flush);
scm_set_port_close (tc, sf_close);
+ scm_set_port_needs_close_on_gc (tc, 1);
scm_set_port_input_waiting (tc, sf_input_waiting);
return tc;