2012-02-19 12:22:12 +01:00
|
|
|
|
#ifndef SCM_FINALIZERS_H
|
|
|
|
|
|
#define SCM_FINALIZERS_H
|
|
|
|
|
|
|
2018-06-20 19:42:07 +02:00
|
|
|
|
/* Copyright 2012, 2013, 2014, 2018
|
2018-06-20 20:01:49 +02:00
|
|
|
|
Free Software Foundation, Inc.
|
|
|
|
|
|
|
|
|
|
|
|
This file is part of Guile.
|
|
|
|
|
|
|
|
|
|
|
|
Guile is free software: you can redistribute it and/or modify it
|
|
|
|
|
|
under the terms of the GNU Lesser General Public License as published
|
|
|
|
|
|
by the Free Software Foundation, either version 3 of the License, or
|
|
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
|
|
|
|
Guile is distributed in the hope that it will be useful, but WITHOUT
|
|
|
|
|
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
|
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
|
|
|
|
|
|
License for more details.
|
|
|
|
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Lesser General Public
|
|
|
|
|
|
License along with Guile. If not, see
|
|
|
|
|
|
<https://www.gnu.org/licenses/>. */
|
2012-02-19 12:22:12 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-06-20 16:33:05 +02:00
|
|
|
|
#include "libguile/scm.h"
|
2012-02-19 12:22:12 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
typedef void (*scm_t_finalizer_proc) (void *obj, void *data);
|
|
|
|
|
|
|
|
|
|
|
|
SCM_INTERNAL void scm_i_set_finalizer (void *obj, scm_t_finalizer_proc,
|
|
|
|
|
|
void *data);
|
|
|
|
|
|
SCM_INTERNAL void scm_i_add_finalizer (void *obj, scm_t_finalizer_proc,
|
|
|
|
|
|
void *data);
|
|
|
|
|
|
SCM_INTERNAL void scm_i_add_resuscitator (void *obj, scm_t_finalizer_proc,
|
|
|
|
|
|
void *data);
|
|
|
|
|
|
|
2012-02-24 13:18:48 +01:00
|
|
|
|
SCM_INTERNAL void scm_i_finalizer_pre_fork (void);
|
|
|
|
|
|
|
2017-03-13 15:47:51 +01:00
|
|
|
|
/* CALLBACK will be called after each garbage collection. It will be
|
|
|
|
|
|
called from a finalizer, which may be from an async or from another
|
|
|
|
|
|
thread. */
|
|
|
|
|
|
SCM_INTERNAL void scm_i_register_async_gc_callback (void (*callback) (void));
|
2013-01-20 11:55:50 +01:00
|
|
|
|
|
2014-04-17 15:29:13 +02:00
|
|
|
|
SCM_API int scm_set_automatic_finalization_enabled (int enabled_p);
|
|
|
|
|
|
SCM_API int scm_run_finalizers (void);
|
|
|
|
|
|
|
2012-02-19 12:22:12 +01:00
|
|
|
|
SCM_INTERNAL void scm_init_finalizers (void);
|
2012-02-24 13:18:48 +01:00
|
|
|
|
SCM_INTERNAL void scm_init_finalizer_thread (void);
|
2012-02-19 12:22:12 +01:00
|
|
|
|
|
|
|
|
|
|
#endif /* SCM_FINALIZERS_H */
|