1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-29 19:30:36 +02:00
Commit graph

197 commits

Author SHA1 Message Date
Andy Wingo
aad5bfed60 Add __scm.h placeholder
* libguile/__scm.h: Add file, mistakenly removed in a previous commit.
2018-06-24 08:47:32 +02:00
Andy Wingo
97cc65fee4 Rename __scm.h to scm.h
* libguile/scm.h: Rename.  Update all includers.
2018-06-20 16:33:33 +02:00
Andy Wingo
d9eafa374c Inline tags.h into __scm.h
* libguile/__scm.h: Inline tags.h, and reformat comments.  Before, these
  files used to include each other!
* libguile.h:
* libguile/atomic.h:
* libguile/boolean.c:
* libguile/eq.h:
* libguile/gc-malloc.c:
* libguile/gc.c:
* libguile/pairs.c:
* libguile/pairs.h:
* libguile/ports.h:
* libguile/print.c:
* libguile/snarf.h:
* libguile/tags.h: Remove tags.h includes.
2018-06-20 16:10:54 +02:00
Andy Wingo
32d94b6a8b Minor __scm.h reformatting
* libguile/__scm.h: Reorder header and use GNU syntax for comments.
2018-06-20 15:49:15 +02:00
Andy Wingo
6e51f89d01 Move SCM_ARG1, etc definitions to error.h
* libguile/__scm.h:
* libguile/error.h (SCM_ARGn, SCM_ARG1, SCM_ARG2, SCM_ARG3, SCM_ARG4)
  (SCM_ARG5 SCM_ARG6 SCM_ARG7): Move here.
2018-06-20 15:14:05 +02:00
Andy Wingo
716d9aaf32 Move SCM_TICK definition to __scm.h.
* libguile/__scm.h:
* libguile/async.h (SCM_TICK): Move here.
2018-06-20 15:10:29 +02:00
Andy Wingo
6a9f73fb8f Remove crufty support for 16-bit architectures.
* libguile/__scm.h: Remove cases for 16-bit architectures (!).
2018-06-20 15:09:57 +02:00
Andy Wingo
51c164a7bc Deprecate pre-stdint.h limit macros
* libguile/__scm.h:
* libguile/deprecated.h:
  (SCM_T_UINT8_MAX, SCM_T_INT8_MIN, SCM_T_INT8_MAX, SCM_T_UINT16_MAX)
  (SCM_T_INT16_MIN, SCM_T_INT16_MAX, SCM_T_UINT32_MAX, SCM_T_INT32_MIN)
  (SCM_T_INT32_MAX, SCM_T_UINT64_MAX, SCM_T_INT64_MIN, SCM_T_INT64_MAX)
  (SCM_T_UINTMAX_MAX, SCM_T_INTMAX_MIN, SCM_T_INTMAX_MAX)
  (SCM_T_UINTPTR_MAX, SCM_T_INTPTR_MIN, SCM_T_INTPTR_MAX): Deprecate.
2018-06-20 15:02:49 +02:00
Andy Wingo
2eb8fa1751 Use stdint.h limit macros
* libguile/__scm.h: Include <stdint.h>, now that we rely on C99.
  (SCM_T_UINT8_MAX, SCM_T_INT8_MIN, SCM_T_INT8_MAX, SCM_T_UINT16_MAX)
  (SCM_T_INT16_MIN, SCM_T_INT16_MAX, SCM_T_UINT32_MAX, SCM_T_INT32_MIN)
  (SCM_T_INT32_MAX, SCM_T_UINT64_MAX, SCM_T_INT64_MIN, SCM_T_INT64_MAX)
  (SCM_T_UINTMAX_MAX, SCM_T_INTMAX_MIN, SCM_T_INTMAX_MAX)
  (SCM_T_UINTPTR_MAX, SCM_T_INTPTR_MIN, SCM_T_INTPTR_MAX): Define in
  terms of equivalent stdint.h definitions.
* libguile/gen-scmconfig.c:
* libguile/instructions.c:
* libguile/numbers.c:
* libguile/random.c:
* libguile/tags.h:
* test-suite/standalone/test-conversion.c: Adapt to use C99 names.
2018-06-20 15:01:13 +02:00
Andy Wingo
2b4ecafab8 Move SCM_C_INLINE_KEYWORD definition to inline.h
* libguile/__scm.h:
* libguile/inline.h (SCM_C_INLINE_KEYWORD): Move this definition here.
2018-06-20 14:40:52 +02:00
Andy Wingo
c495b44714 Remove Emacs local variables comments in Guile source
The .dir-locals.el file in the repository is sufficient for Emacs
users.

* libguile/__scm.h:
* libguile/alist.c:
* libguile/alist.h:
* libguile/array-handle.c:
* libguile/array-handle.h:
* libguile/array-map.c:
* libguile/array-map.h:
* libguile/arrays.c:
* libguile/arrays.h:
* libguile/async.c:
* libguile/async.h:
* libguile/backtrace.c:
* libguile/backtrace.h:
* libguile/bitvectors.c:
* libguile/bitvectors.h:
* libguile/boolean.c:
* libguile/boolean.h:
* libguile/chars.c:
* libguile/chars.h:
* libguile/chooks.c:
* libguile/chooks.h:
* libguile/continuations.c:
* libguile/continuations.h:
* libguile/control.c:
* libguile/conv-integer.i.c:
* libguile/debug-malloc.h:
* libguile/debug.c:
* libguile/debug.h:
* libguile/deprecation.c:
* libguile/deprecation.h:
* libguile/dynl.c:
* libguile/dynl.h:
* libguile/dynstack.c:
* libguile/dynstack.h:
* libguile/dynwind.c:
* libguile/dynwind.h:
* libguile/eq.c:
* libguile/eq.h:
* libguile/error.c:
* libguile/error.h:
* libguile/eval.c:
* libguile/eval.h:
* libguile/evalext.c:
* libguile/evalext.h:
* libguile/expand.c:
* libguile/expand.h:
* libguile/extensions.c:
* libguile/extensions.h:
* libguile/feature.c:
* libguile/feature.h:
* libguile/filesys.c:
* libguile/filesys.h:
* libguile/fluids.c:
* libguile/fluids.h:
* libguile/foreign.c:
* libguile/fports.c:
* libguile/fports.h:
* libguile/frames.c:
* libguile/frames.h:
* libguile/gc-inline.h:
* libguile/gc.c:
* libguile/gc.h:
* libguile/generalized-arrays.c:
* libguile/generalized-arrays.h:
* libguile/generalized-vectors.c:
* libguile/generalized-vectors.h:
* libguile/gettext.c:
* libguile/gettext.h:
* libguile/goops.c:
* libguile/goops.h:
* libguile/gsubr.c:
* libguile/gsubr.h:
* libguile/guardians.c:
* libguile/guardians.h:
* libguile/guile.c:
* libguile/hash.c:
* libguile/hash.h:
* libguile/hashtab.c:
* libguile/hashtab.h:
* libguile/hooks.c:
* libguile/hooks.h:
* libguile/i18n.c:
* libguile/i18n.h:
* libguile/init.c:
* libguile/init.h:
* libguile/instructions.c:
* libguile/instructions.h:
* libguile/intrinsics.c:
* libguile/intrinsics.h:
* libguile/ioext.c:
* libguile/ioext.h:
* libguile/iselect.h:
* libguile/keywords.c:
* libguile/keywords.h:
* libguile/list.c:
* libguile/list.h:
* libguile/load.c:
* libguile/load.h:
* libguile/loader.c:
* libguile/loader.h:
* libguile/macros.c:
* libguile/macros.h:
* libguile/mallocs.c:
* libguile/mallocs.h:
* libguile/memmove.c:
* libguile/memoize.c:
* libguile/memoize.h:
* libguile/modules.c:
* libguile/modules.h:
* libguile/net_db.c:
* libguile/net_db.h:
* libguile/null-threads.c:
* libguile/null-threads.h:
* libguile/numbers.c:
* libguile/numbers.h:
* libguile/objprop.c:
* libguile/objprop.h:
* libguile/options.c:
* libguile/options.h:
* libguile/pairs.c:
* libguile/pairs.h:
* libguile/poll.c:
* libguile/poll.h:
* libguile/ports.c:
* libguile/ports.h:
* libguile/posix.c:
* libguile/posix.h:
* libguile/print.c:
* libguile/print.h:
* libguile/procprop.c:
* libguile/procprop.h:
* libguile/procs.c:
* libguile/procs.h:
* libguile/programs.c:
* libguile/programs.h:
* libguile/promises.c:
* libguile/promises.h:
* libguile/pthread-threads.h:
* libguile/random.c:
* libguile/random.h:
* libguile/rdelim.c:
* libguile/rdelim.h:
* libguile/read.c:
* libguile/read.h:
* libguile/regex-posix.c:
* libguile/regex-posix.h:
* libguile/rw.c:
* libguile/rw.h:
* libguile/scmsigs.c:
* libguile/scmsigs.h:
* libguile/script.c:
* libguile/script.h:
* libguile/simpos.c:
* libguile/simpos.h:
* libguile/smob.c:
* libguile/smob.h:
* libguile/snarf.h:
* libguile/socket.c:
* libguile/socket.h:
* libguile/sort.c:
* libguile/sort.h:
* libguile/srcprop.c:
* libguile/srcprop.h:
* libguile/stackchk.c:
* libguile/stackchk.h:
* libguile/stacks.c:
* libguile/stacks.h:
* libguile/stime.c:
* libguile/stime.h:
* libguile/strerror.c:
* libguile/strings.c:
* libguile/strings.h:
* libguile/strorder.c:
* libguile/strorder.h:
* libguile/strports.c:
* libguile/strports.h:
* libguile/struct.c:
* libguile/struct.h:
* libguile/symbols.c:
* libguile/symbols.h:
* libguile/syntax.c:
* libguile/syscalls.h:
* libguile/tags.h:
* libguile/threads.c:
* libguile/threads.h:
* libguile/throw.c:
* libguile/throw.h:
* libguile/trees.h:
* libguile/unicode.c:
* libguile/unicode.h:
* libguile/uniform.c:
* libguile/uniform.h:
* libguile/values.c:
* libguile/values.h:
* libguile/variable.c:
* libguile/variable.h:
* libguile/vectors.c:
* libguile/vectors.h:
* libguile/version.c:
* libguile/vm-engine.c:
* libguile/vm-expand.h:
* libguile/vm.c:
* libguile/vm.h:
* libguile/vports.c:
* libguile/vports.h:
* libguile/weak-list.h:
* libguile/weak-set.c:
* libguile/weak-set.h:
* libguile/weak-table.c:
* libguile/weak-table.h:
* libguile/weak-vector.c:
* libguile/weak-vector.h: Remove needless trailing comments.
2018-06-20 14:32:28 +02:00
Andy Wingo
5534c2817e Remove useless "classes: h_files" from Guile headers.
* libguile/__scm.h:
* libguile/alist.h:
* libguile/array-handle.h:
* libguile/array-map.h:
* libguile/arrays.h:
* libguile/async.h:
* libguile/backtrace.h:
* libguile/bitvectors.h:
* libguile/boolean.h:
* libguile/chars.h:
* libguile/chooks.h:
* libguile/continuations.h:
* libguile/debug-malloc.h:
* libguile/debug.h:
* libguile/deprecation.h:
* libguile/dynl.h:
* libguile/dynstack.h:
* libguile/dynwind.h:
* libguile/eq.h:
* libguile/error.h:
* libguile/eval.h:
* libguile/evalext.h:
* libguile/expand.h:
* libguile/extensions.h:
* libguile/feature.h:
* libguile/filesys.h:
* libguile/fluids.h:
* libguile/fports.h:
* libguile/gc-inline.h:
* libguile/gc.h:
* libguile/generalized-arrays.h:
* libguile/generalized-vectors.h:
* libguile/gettext.h:
* libguile/goops.h:
* libguile/gsubr.h:
* libguile/guardians.h:
* libguile/hash.h:
* libguile/hashtab.h:
* libguile/hooks.h:
* libguile/i18n.h:
* libguile/init.h:
* libguile/inline.h:
* libguile/ioext.h:
* libguile/iselect.h:
* libguile/keywords.h:
* libguile/list.h:
* libguile/load.h:
* libguile/macros.h:
* libguile/mallocs.c:
* libguile/mallocs.h:
* libguile/memoize.h:
* libguile/modules.h:
* libguile/net_db.h:
* libguile/null-threads.h:
* libguile/numbers.h:
* libguile/objprop.h:
* libguile/options.h:
* libguile/pairs.h:
* libguile/poll.h:
* libguile/ports.h:
* libguile/posix-w32.h:
* libguile/posix.h:
* libguile/print.h:
* libguile/procprop.h:
* libguile/procs.h:
* libguile/promises.h:
* libguile/pthread-threads.h:
* libguile/random.h:
* libguile/rdelim.h:
* libguile/read.h:
* libguile/regex-posix.h:
* libguile/rw.h:
* libguile/scmsigs.h:
* libguile/script.h:
* libguile/simpos.h:
* libguile/smob.h:
* libguile/snarf.h:
* libguile/socket.h:
* libguile/sort.h:
* libguile/srcprop.h:
* libguile/stackchk.h:
* libguile/stacks.h:
* libguile/stime.h:
* libguile/strings.h:
* libguile/strorder.h:
* libguile/strports.h:
* libguile/struct.h:
* libguile/symbols.h:
* libguile/syscalls.h:
* libguile/tags.h:
* libguile/threads.h:
* libguile/throw.h:
* libguile/trees.h:
* libguile/unicode.h:
* libguile/uniform.h:
* libguile/values.h:
* libguile/variable.h:
* libguile/vectors.h:
* libguile/vports.h:
* libguile/weak-list.h:
* libguile/weak-set.h:
* libguile/weak-table.h:
* libguile/weak-vector.h: Remove "classes: h_files".  Reformat
  copyrights if needed.
2018-06-20 14:26:16 +02:00
Andy Wingo
40ade0886e Remove _scm.h
* libguile/_scm.h: Remove.  An internal header, never installed.
* libguile/__scm.h: Remove horrible documentation.
* libguile/Makefile.am (EXTRA_libguile_@GUILE_EFFECTIVE_VERSION@_la_SOURCES):
  Remove _scm.h.
* libguile/alist.c:
* libguile/array-handle.c:
* libguile/array-map.c:
* libguile/arrays.c:
* libguile/async.c:
* libguile/atomic.c:
* libguile/backtrace.c:
* libguile/bitvectors.c:
* libguile/boolean.c:
* libguile/bytevectors.c:
* libguile/chars.c:
* libguile/continuations.c:
* libguile/control.c:
* libguile/debug-malloc.c:
* libguile/debug.c:
* libguile/deprecated.c:
* libguile/deprecation.c:
* libguile/dynl.c:
* libguile/dynstack.c:
* libguile/dynwind.c:
* libguile/eq.c:
* libguile/error.c:
* libguile/eval.c:
* libguile/evalext.c:
* libguile/expand.c:
* libguile/extensions.c:
* libguile/fdes-finalizers.c:
* libguile/feature.c:
* libguile/filesys.c:
* libguile/finalizers.c:
* libguile/fluids.c:
* libguile/foreign-object.c:
* libguile/foreign.c:
* libguile/fports.c:
* libguile/frames.c:
* libguile/gc-malloc.c:
* libguile/gc.c:
* libguile/gen-scmconfig.c:
* libguile/generalized-arrays.c:
* libguile/generalized-vectors.c:
* libguile/gettext.c:
* libguile/goops.c:
* libguile/gsubr.c:
* libguile/guardians.c:
* libguile/hash.c:
* libguile/hashtab.c:
* libguile/hooks.c:
* libguile/i18n.c:
* libguile/init.c:
* libguile/instructions.c:
* libguile/intrinsics.c:
* libguile/ioext.c:
* libguile/keywords.c:
* libguile/list.c:
* libguile/load.c:
* libguile/loader.c:
* libguile/macros.c:
* libguile/mallocs.c:
* libguile/memoize.c:
* libguile/modules.c:
* libguile/net_db.c:
* libguile/null-threads.c:
* libguile/numbers.c:
* libguile/objprop.c:
* libguile/options.c:
* libguile/pairs.c:
* libguile/poll.c:
* libguile/ports-internal.h:
* libguile/ports.c:
* libguile/posix.c:
* libguile/print.c:
* libguile/procprop.c:
* libguile/procs.c:
* libguile/programs.c:
* libguile/promises.c:
* libguile/r6rs-ports.c:
* libguile/random.c:
* libguile/rdelim.c:
* libguile/read.c:
* libguile/regex-posix.c:
* libguile/rw.c:
* libguile/scmsigs.c:
* libguile/script.c:
* libguile/simpos.c:
* libguile/smob.c:
* libguile/socket.c:
* libguile/sort.c:
* libguile/srcprop.c:
* libguile/srfi-1.c:
* libguile/srfi-13.c:
* libguile/srfi-14.c:
* libguile/srfi-4.c:
* libguile/srfi-60.c:
* libguile/stackchk.c:
* libguile/stacks.c:
* libguile/stime.c:
* libguile/strings.c:
* libguile/strorder.c:
* libguile/strports.c:
* libguile/struct.c:
* libguile/symbols.c:
* libguile/syntax.c:
* libguile/threads.c:
* libguile/throw.c:
* libguile/trees.c:
* libguile/unicode.c:
* libguile/uniform.c:
* libguile/values.c:
* libguile/variable.c:
* libguile/vectors.c:
* libguile/version.c:
* libguile/vm.c:
* libguile/vports.c:
* libguile/weak-set.c:
* libguile/weak-table.c:
* libguile/weak-vector.c: Remove _scm.h includes.
2018-06-20 14:26:01 +02:00
Andy Wingo
1ddf42dae0 Devolve threads.h from _scm.h.
* libguile/__scm.h (scm_print_state, scm_t_dynstack): Add forward
  declarations.
* libguile/_scm.h: Remove threads.h.
* libguile/atomic.c:
* libguile/bitvectors.h:
* libguile/bytevectors.c:
* libguile/continuations.h:
* libguile/control.c:
* libguile/deprecation.c:
* libguile/dynl.c:
* libguile/dynstack.h:
* libguile/dynwind.c:
* libguile/extensions.c:
* libguile/fdes-finalizers.c:
* libguile/foreign-object.c:
* libguile/frames.c:
* libguile/guardians.c:
* libguile/hashtab.c:
* libguile/list.c:
* libguile/loader.c:
* libguile/macros.c:
* libguile/memoize.c:
* libguile/net_db.c:
* libguile/pairs.c:
* libguile/procprop.c:
* libguile/rdelim.c:
* libguile/simpos.c:
* libguile/srfi-14.c:
* libguile/srfi-60.c:
* libguile/strings.c:
* libguile/strports.c:
* libguile/syntax.c:
* libguile/syntax.h:
* libguile/unicode.c:
* libguile/variable.c:
* libguile/vectors.c:
* libguile/weak-set.c:
* libguile/weak-set.h:
* libguile/weak-table.c:
* libguile/weak-table.h:
* libguile/weak-vector.c: Add threads.h as appropriate, or possible
  other headers that threads.h pulled in.
2018-06-20 11:52:29 +02:00
Andy Wingo
b64941f5af Define scm_t_wchar in one place
* libguile/__scm.h (scm_t_wchar): Move definition here, closer to
  scm_t_int32 definition (pulled in by scmconfig.h).
* libguile/numbers.h:
* libguile/chars.h: Remove weird maybe-definitions.
2018-06-20 11:38:08 +02:00
Andy Wingo
d340a9709c Shuffle around inline C function implementation
* libguile/__scm.h:
* libguile/inline.h (SCM_C_EXTERN_INLINE, SCM_CAN_INLINE, SCM_INLINE)
  (SCM_INLINE_IMPLEMENTATION): Move definitions here, from __scm.h.
* libguile/strings.h (scm_is_string): Move implementation here, from
  inline.h.
* libguile/inline.c: Add strings.h include.
* libguile/_scm.h: Remove inline.h include.
* libguile/array-handle.h:
* libguile/gc.h:
* libguile/pairs.h:
* libguile/smob.h: Add inline.h includes.
2018-06-20 11:17:13 +02:00
Andy Wingo
63e5eafd83 Assume that if we have GCC, we have GCC >= 3.0.
* 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.
2018-06-17 20:34:05 +02:00
Andy Wingo
f84ce5442e Refactor handling of auxiliary stacks and setjmp/longjmp
* 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.
2018-06-17 13:41:03 +02:00
Andy Wingo
418a7d7af9 Remove #ifdef cases for VMS and Cray.
* libguile/__scm.h:
* libguile/_scm.h:
* libguile/feature.c (scm_init_feature): Remove VMS and Cray cases.
2018-06-17 13:41:03 +02:00
Andy Wingo
aa84489d18 Reimplement dynamic states
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.
2016-12-05 21:46:37 +01:00
Andy Wingo
705e3a83c8 Remove SCM_DEBUG_CELL_ACCESSES==1
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.
2016-11-18 21:18:23 +01:00
Andy Wingo
c957ec7ab0 Use atomics for async interrupts
* 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.
2016-10-26 22:50:26 +02:00
Andy Wingo
6dd9810902 Merge commit '750ac8c592'
Conflicts:
	.gitignore
	libguile/deprecated.c
2013-11-28 14:53:03 +01:00
Mark H Weaver
36c4044007 Don't use the identifier 'noreturn'.
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'.
2013-11-04 19:45:40 -05:00
Mark H Weaver
26d148066f Merge remote-tracking branch 'origin/stable-2.0'
Conflicts:
	configure.ac
	libguile/deprecated.c
	libguile/deprecated.h
	libguile/filesys.h
	libguile/fluids.c
	libguile/fports.c
	libguile/gc.c
	libguile/guile.c
	libguile/numbers.c
	libguile/objcodes.c
	libguile/r6rs-ports.c
	libguile/smob.c
	libguile/socket.c
	libguile/threads.h
	module/language/scheme/decompile-tree-il.scm
	module/language/tree-il/peval.scm
	test-suite/tests/syncase.test
2013-03-28 05:09:53 -04:00
Ludovic Courtès
6db7ee7b3a Make `SCM_LONG_BIT' usable in preprocessor conditionals.
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.
2013-03-07 00:05:46 +01:00
Andy Wingo
b4fa6cc909 Merge remote-tracking branch 'origin/stable-2.0'
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
2013-01-15 10:45:39 +01:00
Andy Wingo
921cd222b9 deprecate SCM_CHAR_CODE_LIMIT and char-code-limit
* 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.
2013-01-10 16:01:06 +01:00
Andy Wingo
2aed2667fc Merge remote-tracking branch 'origin/stable-2.0'
Conflicts:
	libguile/expand.c
	libguile/hashtab.c
	libguile/ports.c
	libguile/vectors.c
	libguile/weaks.c
	module/language/ecmascript/compile-tree-il.scm
	module/language/tree-il/effects.scm
	module/language/tree-il/fix-letrec.scm
	module/language/tree-il/peval.scm
	test-suite/tests/peval.test
2012-07-06 16:52:54 +02:00
Dagobert Michelsen
5e33d0aa37 Add alignment for Sun Studio 12 2012-07-06 13:22:27 +02:00
Andy Wingo
46163e52e5 simplify inline function infrastructure
* 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.
2012-03-08 12:40:27 +01:00
Andy Wingo
91ee7515da Merge remote-tracking branch 'origin/stable-2.0'
Conflicts:
	libguile/__scm.h
	libguile/array-map.c
	libguile/procprop.c
	libguile/tags.h
	module/ice-9/deprecated.scm
	module/ice-9/psyntax-pp.scm
	module/ice-9/psyntax.scm
	test-suite/standalone/test-num2integral.c
	test-suite/tests/regexp.test
2012-01-10 00:41:42 +01:00
Andy Wingo
9a38439301 fix SCM_ASRTGO deprecation
* libguile/__scm.h (SCM_ASRTGO): Whoops, actually remove the ASRTGO
  definitions here.
* libguile/deprecated.h: Fix type of scm_i_deprecated_asrtgo.
2012-01-08 16:01:28 +01:00
Andy Wingo
75917d6243 Revert "SCM is either a union or scm_t_bits"
This reverts commit 80125469ef.

Conflicts:

	libguile/__scm.h
2011-09-15 12:28:03 -07:00
Andy Wingo
4cf77f0946 simplify inline function infrastructure
* 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.
2011-05-26 17:10:01 +02:00
Andy Wingo
44e5b410bd remove SCM_EXIT_SUCCESS and SCM_EXIT_FAILURE definitions
* libguile/__scm.h: Remove unused SCM_EXIT_SUCCESS and SCM_EXIT_FAILURE
  definitions.
2011-05-15 15:34:16 +02:00
Andy Wingo
fa075d40dc scm_wta_* procedures replace SCM_WTA_* 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.
2011-05-15 15:34:16 +02:00
Andy Wingo
6703caf726 SCM_ASSERT to error.h
* libguile/error.h (SCM_ASSERT, SCM_ASSERT_TYPE): Move definition here.
  Remove SCM_RECKLESS case.
* libguile/__scm.h: (From here.)
2011-05-15 15:34:16 +02:00
Andy Wingo
cb5b7677a2 remove SCM_ASRTGO
* libguile/__scm.h (SCM_ASRTGO): Remove unused macro.
2011-05-15 15:34:16 +02:00
Andy Wingo
6dae2c589b remove unused SCM_FENCE definition
* libguile/__scm.h (SCM_FENCE): Remove unused definition.
2011-05-15 15:34:16 +02:00
Andy Wingo
27c6ebcb16 rename scm_async_click() to scm_async_tick(); privatize SCM_ASYNC_TICK
* 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().
2011-05-15 15:34:16 +02:00
Andy Wingo
f311754e17 simplify SCM_TICK
* libguile/__scm.h (SCM_TICK): Define to simply scm_async_tick (or
  SCM_ASYNC_TICK when building Guile).
2011-05-15 15:34:16 +02:00
Andy Wingo
8b8723b307 remove SCM_THREAD_SWITCHING_CODE
* libguile/deprecated.h (SCM_THREAD_SWITCHING_CODE):
* libguile/threads.h: Remove SCM_THREAD_SWITCHING_CODE, adding in a
  deprecation note.

* libguile/__scm.h (SCM_TICK): Remove SCM_THREAD_SWITCHING_CODE.
2011-05-15 15:34:16 +02:00
Andy Wingo
04245bb72f make SCM_I_SETJMP and SCM_I_LONGJMP private
* 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.
2011-05-15 15:34:15 +02:00
Andy Wingo
2acdd822fb move SCM_FLUSH_REGISTER_WINDOWS to continuations.c
* libguile/continuations.c: Move SCM_FLUSH_REGISTER_WINDOWS define
  here...
* libguile/__scm.h: ...from here.
2011-05-15 15:34:15 +02:00
Andy Wingo
5c838a9759 minor __scm.h cleanup
* libguile/__scm.h: Clean up setjmp/longjmp portability defines.
2011-05-15 15:34:15 +02:00
Andy Wingo
8e450381bf remove mention of cheap continuations
* 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.
2011-05-15 15:34:15 +02:00
Andy Wingo
4f1ce27a36 remove SCM_I_LLONG and SCM_I_ULLONG limit defines
* 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.
2011-05-15 15:34:15 +02:00
Andy Wingo
871054f08e remove SCM_I_SIZE limits 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).
2011-05-15 15:34:15 +02:00
Andy Wingo
7b34720346 remove SCM_CHAR_CODE_LIMIT define
* 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.
2011-05-15 15:34:15 +02:00