summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2009-08-18 00:31:32 +0200
committerLudovic Courtès <ludo@gnu.org>2009-08-18 00:31:32 +0200
commit3b882d69fb4d4be9e46767d57c22c5f0e33a9be4 (patch)
treeb3d7a73e01f88cf2e0ddaa9bc4583a96d9bb7ac6
parent1ac8a47f0187d2a96bc4571cb10cbf45b0edc9d4 (diff)
downloadguile-3b882d69fb4d4be9e46767d57c22c5f0e33a9be4.tar.gz
Remove unneeded SMOB mark/free procedures.
* libguile/bytevectors.c (free_bytevector): Remove. (scm_bootstrap_bytevectors): Update accordingly. * libguile/r6rs-ports.c (bip_mark, cbp_mark, bop_free, bop_proc_mark): Remove. (initialize_bytevector_input_ports, initialize_custom_binary_input_ports, initialize_bytevector_output_ports, initialize_custom_binary_output_ports): Update accordingly.
-rw-r--r--libguile/bytevectors.c20
-rw-r--r--libguile/r6rs-ports.c46
2 files changed, 0 insertions, 66 deletions
diff --git a/libguile/bytevectors.c b/libguile/bytevectors.c
index ee7004590..e8c65bf33 100644
--- a/libguile/bytevectors.c
+++ b/libguile/bytevectors.c
@@ -370,25 +370,6 @@ bytevector_equal_p (SCM bv1, SCM bv2)
return scm_bytevector_eq_p (bv1, bv2);
}
-static size_t
-free_bytevector (SCM bv)
-{
-
- if (!SCM_BYTEVECTOR_INLINE_P (bv))
- {
- unsigned c_len;
- signed char *c_bv;
-
- c_bv = SCM_BYTEVECTOR_CONTENTS (bv);
- c_len = SCM_BYTEVECTOR_LENGTH (bv);
-
- scm_gc_free (c_bv, c_len, SCM_GC_BYTEVECTOR);
- }
-
- return 0;
-}
-
-
/* General operations. */
@@ -2086,7 +2067,6 @@ scm_bootstrap_bytevectors (void)
generalized-vector API may want to access bytevectors even though
`(rnrs bytevector)' hasn't been loaded. */
scm_tc16_bytevector = scm_make_smob_type ("bytevector", 0);
- scm_set_smob_free (scm_tc16_bytevector, free_bytevector);
scm_set_smob_print (scm_tc16_bytevector, print_bytevector);
scm_set_smob_equalp (scm_tc16_bytevector, bytevector_equal_p);
diff --git a/libguile/r6rs-ports.c b/libguile/r6rs-ports.c
index e3aa99e16..d9946cbf3 100644
--- a/libguile/r6rs-ports.c
+++ b/libguile/r6rs-ports.c
@@ -104,13 +104,6 @@ make_bip (SCM bv)
return port;
}
-static SCM
-bip_mark (SCM port)
-{
- /* Mark the underlying bytevector. */
- return (SCM_PACK (SCM_STREAM (port)));
-}
-
static int
bip_fill_input (SCM port)
{
@@ -176,7 +169,6 @@ initialize_bytevector_input_ports (void)
scm_make_port_type ("r6rs-bytevector-input-port", bip_fill_input,
NULL);
- scm_set_port_mark (bytevector_input_port_type, bip_mark);
scm_set_port_seek (bytevector_input_port_type, bip_seek);
}
@@ -207,16 +199,6 @@ SCM_DEFINE (scm_open_bytevector_input_port,
#define SCM_CBP_CLOSE_PROC(_port) \
SCM_SIMPLE_VECTOR_REF (SCM_PACK (SCM_STREAM (_port)), 3)
-static SCM
-cbp_mark (SCM port)
-{
- /* Mark the underlying method and object vector. */
- if (SCM_OPENP (port))
- return SCM_PACK (SCM_STREAM (port));
- else
- return SCM_BOOL_F;
-}
-
static scm_t_off
cbp_seek (SCM port, scm_t_off offset, int whence)
#define FUNC_NAME "cbp_seek"
@@ -421,7 +403,6 @@ initialize_custom_binary_input_ports (void)
scm_make_port_type ("r6rs-custom-binary-input-port",
cbip_fill_input, NULL);
- scm_set_port_mark (custom_binary_input_port_type, cbp_mark);
scm_set_port_seek (custom_binary_input_port_type, cbp_seek);
scm_set_port_close (custom_binary_input_port_type, cbp_close);
}
@@ -852,23 +833,6 @@ make_bop (void)
return (scm_values (scm_list_2 (port, bop_proc)));
}
-static size_t
-bop_free (SCM port)
-{
- /* The port itself is necessarily freed _after_ the bop proc, since the bop
- proc holds a reference to it. Thus we can safely free the internal
- buffer when the bop becomes unreferenced. */
- scm_t_bop_buffer *buf;
-
- buf = SCM_BOP_BUFFER (port);
- if (buf->buffer)
- scm_gc_free (buf->buffer, buf->total_len, SCM_GC_BOP);
-
- scm_gc_free (buf, sizeof (* buf), SCM_GC_BOP);
-
- return 0;
-}
-
/* Write SIZE octets from DATA to PORT. */
static void
bop_write (SCM port, const void *data, size_t size)
@@ -952,14 +916,6 @@ SCM_SMOB_APPLY (bytevector_output_port_procedure,
return bv;
}
-SCM_SMOB_MARK (bytevector_output_port_procedure, bop_proc_mark,
- bop_proc)
-{
- /* Mark the port associated with BOP_PROC. */
- return (SCM_PACK (SCM_SMOB_DATA (bop_proc)));
-}
-
-
SCM_DEFINE (scm_open_bytevector_output_port,
"open-bytevector-output-port", 0, 1, 0,
(SCM transcoder),
@@ -983,7 +939,6 @@ initialize_bytevector_output_ports (void)
NULL, bop_write);
scm_set_port_seek (bytevector_output_port_type, bop_seek);
- scm_set_port_free (bytevector_output_port_type, bop_free);
}
@@ -1102,7 +1057,6 @@ initialize_custom_binary_output_ports (void)
scm_make_port_type ("r6rs-custom-binary-output-port",
NULL, cbop_write);
- scm_set_port_mark (custom_binary_output_port_type, cbp_mark);
scm_set_port_seek (custom_binary_output_port_type, cbp_seek);
scm_set_port_close (custom_binary_output_port_type, cbp_close);
}