mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-16 16:50:21 +02:00
Remove unneeded SMOB/port mark/free procedures.
* libguile/arrays.c (array_mark, array_free): Remove. (scm_init_arrays): Adjust accordingly. * libguile/bitvectors.c (bitvector_free): Remove. (scm_c_make_bitvector): Use `scm_gc_malloc_pointerless ()'. (scm_init_bitvectors): Adjust accordingly. * libguile/strports.c (scm_make_stptob): Remove `scm_set_port_mark ()' call. * libguile/vports.c (scm_make_sfptob): Likewise.
This commit is contained in:
parent
3051344be5
commit
8cf0dd6104
4 changed files with 3 additions and 33 deletions
|
@ -1094,22 +1094,6 @@ scm_i_read_array (SCM port, int c)
|
|||
}
|
||||
|
||||
|
||||
static SCM
|
||||
array_mark (SCM ptr)
|
||||
{
|
||||
return SCM_I_ARRAY_V (ptr);
|
||||
}
|
||||
|
||||
static size_t
|
||||
array_free (SCM ptr)
|
||||
{
|
||||
scm_gc_free (SCM_I_ARRAY_MEM (ptr),
|
||||
(sizeof (scm_i_t_array)
|
||||
+ SCM_I_ARRAY_NDIM (ptr) * sizeof (scm_t_array_dim)),
|
||||
"array");
|
||||
return 0;
|
||||
}
|
||||
|
||||
static SCM
|
||||
array_handle_ref (scm_t_array_handle *h, size_t pos)
|
||||
{
|
||||
|
@ -1146,8 +1130,6 @@ void
|
|||
scm_init_arrays ()
|
||||
{
|
||||
scm_i_tc16_array = scm_make_smob_type ("array", 0);
|
||||
scm_set_smob_mark (scm_i_tc16_array, array_mark);
|
||||
scm_set_smob_free (scm_i_tc16_array, array_free);
|
||||
scm_set_smob_print (scm_i_tc16_array, scm_i_print_array);
|
||||
scm_set_smob_equalp (scm_i_tc16_array, scm_array_equal_p);
|
||||
|
||||
|
|
|
@ -45,15 +45,6 @@ static scm_t_bits scm_tc16_bitvector;
|
|||
#define BITVECTOR_BITS(obj) ((scm_t_uint32 *)SCM_SMOB_DATA(obj))
|
||||
#define BITVECTOR_LENGTH(obj) ((size_t)SCM_SMOB_DATA_2(obj))
|
||||
|
||||
static size_t
|
||||
bitvector_free (SCM vec)
|
||||
{
|
||||
scm_gc_free (BITVECTOR_BITS (vec),
|
||||
sizeof (scm_t_uint32) * ((BITVECTOR_LENGTH (vec)+31)/32),
|
||||
"bitvector");
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
bitvector_print (SCM vec, SCM port, scm_print_state *pstate)
|
||||
{
|
||||
|
@ -120,7 +111,7 @@ scm_c_make_bitvector (size_t len, SCM fill)
|
|||
scm_t_uint32 *bits;
|
||||
SCM res;
|
||||
|
||||
bits = scm_gc_malloc (sizeof (scm_t_uint32) * word_len,
|
||||
bits = scm_gc_malloc_pointerless (sizeof (scm_t_uint32) * word_len,
|
||||
"bitvector");
|
||||
SCM_NEWSMOB2 (res, scm_tc16_bitvector, bits, len);
|
||||
|
||||
|
@ -896,7 +887,6 @@ void
|
|||
scm_init_bitvectors ()
|
||||
{
|
||||
scm_tc16_bitvector = scm_make_smob_type ("bitvector", 0);
|
||||
scm_set_smob_free (scm_tc16_bitvector, bitvector_free);
|
||||
scm_set_smob_print (scm_tc16_bitvector, bitvector_print);
|
||||
scm_set_smob_equalp (scm_tc16_bitvector, bitvector_equalp);
|
||||
|
||||
|
|
|
@ -573,7 +573,6 @@ scm_make_stptob ()
|
|||
{
|
||||
scm_t_bits tc = scm_make_port_type ("string", stfill_buffer, st_write);
|
||||
|
||||
scm_set_port_mark (tc, scm_markstream);
|
||||
scm_set_port_end_input (tc, st_end_input);
|
||||
scm_set_port_flush (tc, st_flush);
|
||||
scm_set_port_seek (tc, st_seek);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 1995,1996,1998,1999,2000,2001, 2002, 2003, 2006 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1995,1996,1998,1999,2000,2001, 2002, 2003, 2006, 2009 Free Software Foundation, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public License
|
||||
|
@ -220,7 +220,6 @@ scm_make_sfptob ()
|
|||
{
|
||||
scm_t_bits tc = scm_make_port_type ("soft", sf_fill_input, sf_write);
|
||||
|
||||
scm_set_port_mark (tc, scm_markstream);
|
||||
scm_set_port_flush (tc, sf_flush);
|
||||
scm_set_port_close (tc, sf_close);
|
||||
scm_set_port_input_waiting (tc, sf_input_waiting);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue