summaryrefslogtreecommitdiff
path: root/libguile/struct.c
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2012-02-19 12:23:29 +0100
committerAndy Wingo <wingo@pobox.com>2012-02-19 20:46:14 +0100
commit6978c673393a960d7caf604b8c72ff2b5fe0f4ec (patch)
treef768bd982fed6c784aada48070518c1eb2f13bb9 /libguile/struct.c
parent6e9ec86dc0dad255ac120e1a5e77e10f1c544fbc (diff)
downloadguile-6978c673393a960d7caf604b8c72ff2b5fe0f4ec.tar.gz
use the new finalizer helpers
* libguile/foreign.c (scm_set_pointer_finalizer_x) * libguile/ports.c (finalize_port, scm_c_make_port_with_encoding) (open_iconv_descriptors) * libguile/smob.c (scm_i_new_smob, scm_i_new_double_smob) * libguile/struct.c (scm_i_alloc_struct) * libguile/weak-set.c (weak_gc_finalizer) (scm_c_register_weak_gc_callback) * libguile/weak-table.c (scm_c_register_weak_gc_callback) (weak_gc_finalizer) * libguile/numbers.c (make_bignum): Use the new API.
Diffstat (limited to 'libguile/struct.c')
-rw-r--r--libguile/struct.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/libguile/struct.c b/libguile/struct.c
index 35e6c681f..12a884256 100644
--- a/libguile/struct.c
+++ b/libguile/struct.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996,1997,1998,1999,2000,2001, 2003, 2004, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+/* Copyright (C) 1996,1997,1998,1999,2000,2001, 2003, 2004, 2006, 2007, 2008, 2009, 2010, 2011, 2012 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
@@ -444,16 +444,8 @@ scm_i_alloc_struct (scm_t_bits *vtable_data, int n_words)
/* vtable_data can be null when making a vtable vtable */
if (vtable_data && vtable_data[scm_vtable_index_instance_finalize])
- {
- /* Register a finalizer for the newly created instance. */
- GC_finalization_proc prev_finalizer;
- GC_PTR prev_finalizer_data;
- GC_REGISTER_FINALIZER_NO_ORDER (SCM2PTR (ret),
- struct_finalizer_trampoline,
- NULL,
- &prev_finalizer,
- &prev_finalizer_data);
- }
+ /* Register a finalizer for the newly created instance. */
+ scm_i_set_finalizer (SCM2PTR (ret), struct_finalizer_trampoline, NULL);
return ret;
}