* libguile/__scm.h (SCM_GNUC_PREREQ): Remove this definition. Assume
that if we have GCC, that we have GCC >= 3.0 (from 2002). Adapt uses
to use simply "#ifdef __GNUC__".
* libguile/deprecated.h (SCM_GNUC_PREREQ): Add deprecated definition.
* libguile/__scm.h (scm_i_jmp_buf): Remove definition, which was a shim
for ia64. Instead, always use setjmp/longjmp and jmp_buf.
* libguile/_scm.h (SCM_I_SETJMP, SCM_I_LONGJMP): Remove; instead use
setjmp and longjmp.
* libguile/continuations.c (capture_auxiliary_stack):
(restore_auxiliary_stack): New helpers.
(scm_i_make_continuation): Use capture_auxiliary_stack.
(copy_stack_and_call): Use restore_auxiliary_stack. No need to stash
the aux stack on the thread, either.
* libguile/continuations.h (scm_t_contregs): Use
SCM_HAVE_AUXILIARY_STACK to flag when to have an auxiliary_stack
member.
* libguile/control.h:
* libguile/control.c (reify_partial_continuation, scm_c_abort):
(scm_suspendable_continuation_p): Adapt to use setjmp/longjmp
directly.
* libguile/deprecated.h: Add deprecated scm_i_jmp_buf define.
* libguile/dynstack.h:
* libguile/dynstack.c (PROMPT_JMPBUF):
(scm_dynstack_push_prompt, scm_dynstack_find_prompt):
(scm_dynstack_wind_prompt): Adapt to jmp_buf type.
* libguile/eval.c (eval): Use jmp_buf and setjmp directly.
* libguile/gc-malloc.c: No need for ia64-specific things.
* libguile/gc.c: No need for ia64-specific things.
* libguile/gc.h: No need to declare scm_ia64_ar_bsp.
* libguile/init.c: Remove typedef of setjmp_type for Cray, unused.
* libguile/threads.c (guilify_self_1): No more pending_rbs_continuation
in scm_i_thread, and register_backing_store_base is handled by libgc.
(scm_ia64_ar_bsp): Remove definitions; inlined into continuations.c's
capture_auxiliary_stack.
* libguile/threads.h (scm_i_thread): jmpbuf member is plain jmp_buf.
* libguile/throw.c (catch): Just use jmp_buf and setjmp.
* libguile/vm-engine.c (VM_NAME): Adapt prototype to take jmp_buf
pointer.
* libguile/vm.c (vm_abort): Adapt jmp_buf types.
(scm_call_n): Use setjmp.
There are two goals: one, to use less memory per dynamic state in order
to allow millions of dynamic states to be allocated in light-weight
threading scenarios. The second goal is to prevent dynamic states from
being actively mutated in two threads at once. This second goal does
mean that dynamic states object that escape into scheme are now copies
that won't receive further updates; an incompatible change, but one
which we hope doesn't affect anyone.
* libguile/cache-internal.h: New file.
* libguile/fluids.c (is_dynamic_state, get_dynamic_state)
(save_dynamic_state, restore_dynamic_state, add_entry)
(copy_value_table): New functions.
(scm_i_fluid_print, scm_i_dynamic_state_print): Move up.
(new_fluid): No need for a number.
(scm_fluid_p: scm_is_fluid): Inline IS_FLUID uses.
(fluid_set_x, fluid_ref): Adapt to dynamic state changes.
(scm_fluid_set_x, scm_fluid_unset_x): Call fluid_set_x.
(scm_swap_fluid): Rewrite in terms of fluid_ref and fluid_set.
(swap_fluid): Use internal fluid_set_x.
(scm_i_make_initial_dynamic_state): Adapt to dynamic state
representation change.
(scm_dynamic_state_p, scm_is_dynamic_state): Use new accessors.
(scm_current_dynamic_state): Use make_dynamic_state.
(scm_dynwind_current_dynamic_state): Use new accessor.
* libguile/fluids.h: Remove internal definitions. Add new struct
definition.
* libguile/threads.h (scm_i_thread): Use scm_t_dynamic_state for dynamic
state.
* libguile/threads.c (guilify_self_1, guilify_self_2):
(scm_i_init_thread_for_guile, scm_init_guile):
(scm_call_with_new_thread):
(scm_init_threads, scm_init_threads_default_dynamic_state): Adapt to
scm_i_thread change.
(scm_i_with_guile, with_guile): Remove "and parent" suffix.
(scm_i_reset_fluid): Remove unneeded function.
* doc/ref/api-scheduling.texi (Fluids and Dynamic States): Remove
scm_make_dynamic_state docs. Update current-dynamic-state docs.
* libguile/vm-engine.c (vm_engine): Update fluid-ref and fluid-set!
inlined fast paths for dynamic state changes.
* libguile/vm.c (vm_error_unbound_fluid): Remove now-unused function.
* NEWS: Update.
* module/ice-9/deprecated.scm (make-dynamic-state): New definition.
* libguile/deprecated.h:
* libguile/deprecated.c (scm_make_dynamic_state): Move here.
* libguile/__scm.h (scm_t_dynamic_state): New typedef.
* libguile/dynstack.h:
* libguile/dynstack.c (scm_dynstack_push_fluid):
(scm_dynstack_unwind_fluid): Take raw dynstate in these internal
functions.
* libguile/throw.c (catch): Adapt to dynstack changes.
Since the move to BDW-GC this option has not been useful.
* libguile/__scm.h (SCM_DEBUG_CELL_ACCESSES): Remove default
definition.
* libguile/gc.h: Add comment about cells.
(SCM_VALIDATE_CELL): Remove. I did a search on the internet and I
found no external users.
(SCM_CELL_WORD, SCM_CELL_OBJECT, SCM_SET_CELL_WORD)
(SCM_SET_CELL_OBJECT, SCM_CELL_OBJECT_LOC): Remove SCM_VALIDATE_CELL
uses.
* libguile/gc.c (scm_debug_cell_accesses_p)
(scm_expensive_debug_cell_accesses_p)
(scm_debug_cells_gc_interval, scm_i_expensive_validation_check)
(scm_assert_cell_valid): Remove bindings only available when
SCM_DEBUG_CELL_ACCESSES was 1.
* libguile/list.c (scm_list_n): Remove SCM_VALIDATE_CELL usage.
* libguile/__scm.h (SCM_TICK): Always define as scm_async_tick().
* libguile/error.c (scm_syserror, scm_syserror_msg):
* libguile/fports.c (fport_read, fport_write):
* libguile/_scm.h (SCM_SYSCALL): Replace SCM_ASYNC_TICK with
scm_async_tick ().
(SCM_ASYNC_TICK, SCM_ASYNC_TICK_WITH_CODE)
(SCM_ASYNC_TICK_WITH_GUARD_CODE): Remove internal definitions. We
inline into vm-engine.c, the only place where it matters.
* libguile/async.h:
* libguile/async.c (scm_async_tick, scm_i_setup_sleep):
(scm_i_reset_sleep, scm_system_async_mark_for_thread):
* libguile/threads.h (struct scm_thread_wake_data):
* libguile/threads.h (scm_i_thread):
* libguile/threads.c (block_self, guilify_self_1, scm_std_select):
Rewrite to use sequentially-consistent atomic references.
* libguile/atomics-internal.h (scm_atomic_set_pointer):
(scm_atomic_ref_pointer): New definitions.
* libguile/finalizers.c (queue_finalizer_async): We can allocate, so
just use scm_system_async_mark_for_thread instead of the set-cdr!
shenanigans.
* libguile/scmsigs.c (take_signal):
* libguile/gc.c (queue_after_gc_hook): Adapt to new asyncs mechanism.
Can't allocate but we're just manipulating the current thread when no
other threads are running so we should be good.
* libguile/vm-engine.c (VM_HANDLE_INTERRUPTS): Inline the async_tick
business.
Fixes <http://bugs.gnu.org/15798>.
Reported by Matt Sicker <boards@gmail.com>.
* libguile/__scm.h (SCM_NORETURN): Use ((__noreturn__)) instead of
((noreturn)).
* libguile/throw.h (scm_ithrow): Rename formal parameter from 'noreturn'
to 'no_return'.
* libguile/throw.c (scm_ithrow): Rename formal parameter from 'noreturn'
to 'no_return'.
Reported by Jan Schukat <shookie@email.de>.
Partly fixes <http://bugs.gnu.org/13848>.
* libguile/__scm.h (SCM_LONG_BIT)[!defined LONG_BIT]: Use
SCM_SIZEOF_LONG since `sizeof' cannot be used in #if directives as
found in numbers.c.
There is a failing test due to a scm_from_utf8_stringn bug brought out
by the iconv test that will be fixed in the next commit.
Conflicts:
libguile/deprecated.h
module/ice-9/deprecated.scm
* libguile/__scm.h:
* libguile/deprecated.h (SCM_CHAR_CODE_LIMIT): Move declaration here
from __scm.h.
* libguile/feature.c:
* module/ice-9/deprecated.scm (char-code-limit): Move definition here.
* test-suite/tests/regexp.test: Update to not use char-code-limit.
* libguile/__scm.h (SCM_C_EXTERN_INLINE): Move this definition here,
from inline.h. We'd like to support inline function definitions in
more header files: not just inline.h.
(SCM_CAN_INLINE, SCM_INLINE, SCM_INLINE_IMPLEMENTATION): New
definitions.
* libguile/gc.h (SCM_GC_MALLOC, SCM_GC_MALLOC_POINTERLESS): Define these
wrappers, which redirect to the GC_MALLOC macros when building Guile,
and the scm_gc_malloc functions otherwise. A step towards getting
BDW-GC out of Guile's API.
* libguile/inline.h: Simplify, using SCM_INLINE,
SCM_INLINE_IMPLEMENTATION, and SCM_IMPLEMENT_INLINES. Also use the
new SCM_GC_MALLOC macros.
* libguile/__scm.h (SCM_C_EXTERN_INLINE): Move this definition here,
from inline.h. We'd like to support inline function definitions in
more header files: not just inline.h.
(SCM_CAN_INLINE, SCM_INLINE, SCM_INLINE_IMPLEMENTATION): New
definitions.
* libguile/gc.h (SCM_GC_MALLOC, SCM_GC_MALLOC_POINTERLESS): Define these
wrappers, which redirect to the GC_MALLOC macros when building Guile,
and the scm_gc_malloc functions otherwise. A step towards getting
BDW-GC out of Guile's API.
* libguile/inline.h: Simplify, using SCM_INLINE,
SCM_INLINE_IMPLEMENTATION, and SCM_IMPLEMENT_INLINES. Also use the
new SCM_GC_MALLOC macros.
* libguile/__scm.h: Move all the SCM_WTA and SCM_GASSERT macros out of
here. Also remove the scm_call_generic declarations.
* libguile/deprecated.h (SCM_WTA_DISPATCH_0, SCM_WTA_DISPATCH_1):
(SCM_WTA_DISPATCH_2, SCM_WTA_DISPATCH_N): Deprecate. See below for
their replacements.
(SCM_GASSERT0, SCM_GASSERT1, SCM_GASSERT2, SCM_GASSERTn): Deprecate
these too.
(SCM_WTA_DISPATCH_1_SUBR): Deprecate this strange thing.
(scm_call_generic_0, scm_call_generic_1, scm_call_generic_2):
(scm_call_generic_3, scm_apply_generic): Remove, indicating their
replacements.
* libguile/print.c (iprin1):
* libguile/eq.c (scm_equal_p): Use scm_call_2 instead of
scm_call_generic_2.
* libguile/goops.h:
* libguile/goops.c: Remove scm_{call,apply}_generic definitions.
(scm_wta_dispatch_0, scm_wta_dispatch_1, scm_wta_dispatch_2):
(scm_wta_dispatch_n): New procedures, replacing the SCM_WTA macros.
* libguile/numbers.c (scm_lcm):
* libguile/procs.c (scm_setter): Remove uses of SCM_GASSERT.
* libguile/numbers.c (scm_lcm):
* libguile/procs.c (scm_setter):
* libguile/vectors.c: Use the procedural scm_wta routines instead of the
SCM_WTA macros.
* libguile/_scm.h (SCM_ASYNC_TICK, SCM_ASYNC_TICK_WITH_CODE): Make these
definitions private. Call the tick() function instead of click().
* libguile/__scm.h:
* libguile/async.h (scm_async_tick): Move declaration here. Remove
scm_async_click declaration. Tick is the new (and old!) click, you
see.
(SCM_CRITICAL_SECTION_END): Call tick() instead of click().
* libguile/async.c (scm_async_tick): Remove old definition, and rename
scm_async_click to scm_async_tick.
(decrease_block): Adapt to click() -> tick() name change.
* libguile/deprecated.h (scm_async_click, SCM_ASYNC_TICK): Define some
GONE macros.
* libguile/threads.c (fat_mutex_unlock): Tick() instead of click().
* libguile/_scm.h (SCM_I_SETJMP, SCM_I_LONGJMP): Move to this private
header.
* libguile/__scm.h (scm_i_jmp_buf): Only define the scm_i_jmp_buf type
in this public header.
* libguile/__scm.h: Inline an #ifndef CHEAP_CONTINUATIONS block for
VMS, as we always have full continuations.
* libguile/feature.c (scm_init_feature): Don't bother defining the
"full-continuation" feature.
* test-suite/standalone/test-num2integral.c (test_long_long):
(test_ulong_long): Replace SCM_I_LLONG and SCM_I_ULLONG defines with
their counterparts from limits.h.
* libguile/__scm.h: Remove SCM_I_LLONG and SCM_I_ULLONG limit defines.
* libguile/__scm.h: Remove defines for SCM_I_SIZE_MAX, SCM_I_SSIZE_MIN,
and SCM_I_SSIZE_MAX, as there is no longer a scm_t_size / scm_size_t
type.
* libguile/bytevectors.c (make_bytevector): Replace a use of
SCM_I_SIZE_MAX with ((size_t) -1).
* libguile/__scm.h: Remove SCM_CHAR_CODE_LIMIT define.
* libguile/feature.c (scm_init_feature): Remove char-code-limit define,
which was sure to be 256: a bogus value.