mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-07-02 15:40:38 +02:00
Move fluids off of scm_cell
* libguile/fluids-internal.h: New file for internal definitions. * libguile/dynstack.c: * libguile/init.c: * libguile/intrinsics.c: * libguile/modules.c: * libguile/print.c: * libguile/threads.c: Include new internal file. * libguile/fluids.c: Use "struct scm_fluid". * libguile/Makefile.am: Add new file.
This commit is contained in:
parent
8141c35ec4
commit
453fe41a26
10 changed files with 116 additions and 57 deletions
71
libguile/fluids-internal.h
Normal file
71
libguile/fluids-internal.h
Normal file
|
@ -0,0 +1,71 @@
|
|||
#ifndef SCM_FLUIDS_INTERNAL_H
|
||||
#define SCM_FLUIDS_INTERNAL_H
|
||||
|
||||
/* Copyright 1996,2000-2001,2006,2008-2013,2018,2025
|
||||
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/>. */
|
||||
|
||||
|
||||
|
||||
#include <libguile/fluids.h>
|
||||
#include <libguile/gc.h>
|
||||
#include <libguile/cache-internal.h>
|
||||
|
||||
struct scm_fluid
|
||||
{
|
||||
scm_t_bits tag_and_flags;
|
||||
SCM default_value;
|
||||
};
|
||||
|
||||
static inline struct scm_fluid*
|
||||
scm_to_fluid (SCM x)
|
||||
{
|
||||
if (!scm_is_fluid (x))
|
||||
abort ();
|
||||
return (struct scm_fluid *) SCM_UNPACK_POINTER (x);
|
||||
}
|
||||
|
||||
static inline SCM
|
||||
scm_from_fluid (struct scm_fluid *fluid)
|
||||
{
|
||||
return SCM_PACK_POINTER (fluid);
|
||||
}
|
||||
|
||||
struct scm_ephemeron_table;
|
||||
struct scm_dynamic_state
|
||||
{
|
||||
SCM thread_local_values;
|
||||
struct scm_ephemeron_table *values;
|
||||
uint8_t has_aliased_values;
|
||||
struct scm_cache cache;
|
||||
};
|
||||
|
||||
SCM_INTERNAL SCM scm_i_fluid_ref (scm_thread *thread, SCM fluid);
|
||||
|
||||
SCM_INTERNAL void scm_swap_fluid (SCM fluid, SCM value_box,
|
||||
scm_t_dynamic_state *dynamic_state);
|
||||
|
||||
SCM_INTERNAL SCM scm_dynamic_state_ref (SCM state, SCM fluid, SCM dflt);
|
||||
|
||||
SCM_INTERNAL SCM scm_i_make_initial_dynamic_state (void);
|
||||
|
||||
SCM_INTERNAL void scm_i_fluid_print (SCM exp, SCM port, scm_print_state *pstate);
|
||||
SCM_INTERNAL void scm_i_dynamic_state_print (SCM exp, SCM port, scm_print_state *pstate);
|
||||
SCM_INTERNAL void scm_init_fluids (void);
|
||||
|
||||
#endif /* SCM_FLUIDS_INTERNAL_H */
|
Loading…
Add table
Add a link
Reference in a new issue