mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-06 15:40:29 +02:00
Prepare structs for new finalization API
* libguile/struct.h: * libguile/struct.c (scm_i_finalize_struct): New helper. (struct_finalizer_trampoline): Implement as shim.
This commit is contained in:
parent
5e97645b81
commit
9774b3e551
2 changed files with 10 additions and 4 deletions
|
@ -310,16 +310,21 @@ SCM_DEFINE (scm_struct_vtable_p, "struct-vtable?", 1, 0, 0,
|
|||
|
||||
|
||||
/* Finalization: invoke the finalizer of the struct pointed to by PTR. */
|
||||
static void
|
||||
struct_finalizer_trampoline (void *ptr, void *unused_data)
|
||||
void
|
||||
scm_i_finalize_struct (struct scm_thread *thread, SCM obj)
|
||||
{
|
||||
SCM obj = PTR2SCM (ptr);
|
||||
scm_t_struct_finalize finalize = SCM_STRUCT_FINALIZER (obj);
|
||||
|
||||
if (finalize)
|
||||
finalize (obj);
|
||||
}
|
||||
|
||||
static void
|
||||
struct_finalizer_trampoline (void *ptr, void *data)
|
||||
{
|
||||
scm_i_finalize_struct (SCM_I_CURRENT_THREAD, PTR2SCM (ptr));
|
||||
}
|
||||
|
||||
/* A struct is a sequence of words preceded by a pointer to the struct's
|
||||
vtable. The vtable reference is tagged with the struct tc3. */
|
||||
static SCM
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue