1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-04 05:50:26 +02:00

add SCM_HEAP_OBJECT_BASE

* libguile/tags.h (SCM_HEAP_OBJECT_BASE): New macro.  Given a SCM,
  returns a pointer to the start of its memory area on the heap.

* libguile/bytevectors.c:
* libguile/fluids.c:
* libguile/foreign.c:
* libguile/gc.h:
* libguile/guardians.c:
* libguile/numbers.h:
* libguile/ports.c:
* libguile/smob.c:
* libguile/struct.c:
* libguile/weak-set.c:
* libguile/weak-table.c:
* libguile/weak-vector.c: Use it.
This commit is contained in:
Andy Wingo 2013-01-15 18:29:59 +01:00
parent 449ca87bdb
commit 03daea184e
14 changed files with 54 additions and 36 deletions

View file

@ -1,4 +1,4 @@
/* Copyright (C) 1996,1997,1998,1999,2000,2001, 2003, 2004, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
/* Copyright (C) 1996,1997,1998,1999,2000,2001, 2003, 2004, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 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
@ -445,7 +445,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. */
scm_i_set_finalizer (SCM2PTR (ret), struct_finalizer_trampoline, NULL);
scm_i_set_finalizer (SCM_HEAP_OBJECT_BASE (ret),
struct_finalizer_trampoline, NULL);
return ret;
}