Fixes <http://bugs.gnu.org/18495>.
* libguile/smob.h (SCM_SMOB_OBJECT_LOC, SCM_SMOB_OBJECT_0_LOC)
(SCM_SMOB_OBJECT_1_LOC, SCM_SMOB_OBJECT_2_LOC)
(SCM_SMOB_OBJECT_3_LOC): These elementary API macros have been broken
by commit 56164dc47f in 2009.
Signed-off-by: David Kastrup <dak@gnu.org>
Subset of a patch by Andreas Schwab <schwab@linux-m68k.org>.
Reported by Rob Browning <rlb@defaultvalue.org>.
* libguile/vm-engine.h (IP_REG)[__mc68000__]: Use register "a3".
Reported by Rob Browning <rlb@defaultvalue.org>.
* libguile/vm-engine.h (IP_REG)[__arm__]: Remove explicit register
choice ("r7") for FP_REG, which was reported to cause compilation
failures on ARM.
Reported by Rob Browning <rlb@defaultvalue.org>.
* libguile/vm-i-scheme.c (ASM_MUL)[ARM]: Add earlyclobber (&) constraint
to the SMULL output registers.
Based on a patch by Eli Zaretskii <eliz@gnu.org>.
* libguile/i18n.c (copy_string_or_null): New static function.
(scm_nl_langinfo): Use 'copy_string_or_null' to copy the result from
'nl_langinfo' and 'nl_langinfo_l' before the next call and before
releasing the locale mutex.
* libguile/bitvectors.c (scm_bit_count_star): Fix typo introduced in
2005 refactor (!) in which the second arg was erroneously taken from
the first arg.
* test-suite/tests/bitvectors.test: Add test.
* doc/ref/api-compound.texi: Fix doc example for u32vector selector.
Reported by Sylvain Beucler <beuc@beuc.net>.
* configure.ac: Check for 'pthread_cancel'.
* libguile/threads.c (scm_cancel_thread): Conditionalize on
!SCM_USE_PTHREAD_THREADS || defined HAVE_PTHREAD_CANCEL.
* test-suite/tests/threads.test (require-cancel-thread): New procedure.
("timed joining fails if timeout exceeded", "join-thread returns
timeoutval on timeout", "cancel succeeds", "handler result passed to
join", "can cancel self"): Use it.
* libguile/load.c (scm_i_mirror_backslashes): New function.
(scm_init_load_path): Call it to produce MS-Windows file names
with forward slashes.
(FILE_NAME_SEPARATOR_STRING): Define as "/" on all platforms.
* libguile/load.h (scm_i_mirror_backslashes): Add prototype.
* libguile/init.c (scm_boot_guile): Call scm_i_mirror_backslashes
on argv[0].
* libguile/filesys.c (scm_getcwd): Call scm_i_mirror_backslashes
on the directory name returned by getcwd.
* test-suite/tests/ports.test ("file name separators"): New test.
* libguile/simpos.c (scm_system_star) [!HAVE_FORK]: An
implementation of 'system*' for MS-Windows, which doesn't have
'fork', but can use 'spawnvp' in this case.
* libguile/bitvectors.c (scm_bit_count_star): Fix typo introduced in
2005 refactor (!) in which the second arg was erroneously taken from
the first arg.
* test-suite/tests/bitvectors.test: Add test.
* doc/ref/api-compound.texi: Fix doc example for u32vector selector.
* libguile/list.c (scm_ilength): Test for SCM_NULL_OR_NIL_P only after
testing scm_is_pair. Conform to GNU coding standards.
* libguile/srfi-1.c (scm_srfi1_length_plus): Ditto.
Fixes <http://bugs.gnu.org/17296>.
* libguile/srfi-1.c (scm_srfi1_length_plus): Rewrite to raise an error
unless passed a proper or circular list, based on code from
'scm_ilength'.
* test-suite/tests/srfi-1.test (length+): Add tests.
Fixes <http://bugs.gnu.org/17661>.
Reported and fixed by Chris Vine <chris@cvine.freeserve.co.uk>.
* libguile/async.h (scm_c_call_with_blocked_asyncs)
(scm_c_call_with_unblocked_asyncs, scm_dynwind_block_asyncs)
(scm_dynwind_unblock_asyncs): Mark as SCM_API.
* THANKS: Add Chris Vine to fixes section.
Fixes <http://bugs.gnu.org/17466>.
Reported by J Kalbhenn <jkal@posteo.eu>.
* libguile/bytevectors.c (scm_c_shrink_bytevector): When BV is
contiguous, add use of 'SCM_BYTEVECTOR_SET_CONTENTS'.
* libguile/fports.c (scm_setvbuf): Initialize 'drained'. GCC 4.9 raises
a "may be used uninitialized warning" for 'drained', because it can't
tell that 'drained' is initialized anytime NDRAINED > 0.
* libguile/vm-engine.c (vm_engine): Always invoke the apply hook after
the ip has been reset. Avoids problems in frame-bindings, which
builds its bindings map based on the IP. Invoke push-continuation
before linking the new frame, so that more locals are available to the
frame inspector.
* module/system/vm/traps.scm (trap-in-procedure): No need for a
push-cont handler, as the apply handler will exit the frame.
* libguile/frames.c (scm_frame_address, scm_frame_stack_pointer): Return
offsets instead of absolute pointers. This is robust in the presence
of stack relocation.
* module/system/repl/debug.scm (print-registers): Adapt to print sp and
fp as integers.
* doc/ref/api-debug.texi (Stack Capture): Update make-stack docs.
* libguile/programs.h:
* libguile/programs.c (scm_program_address_range): New internal
procedure.
* libguile/stacks.c (narrow_stack): Interpret a pair of integers as an
address range. If a cut is a procedure, attempt to resolve it to an
address range.
(scm_make_stack): Update docstring.
* module/system/vm/program.scm (program-address-range): New exported
procedure.
* module/statprof.scm (statprof, gcprof): Use program-address-range to
get the outer-cut, for efficiency.
* libguile/foreign-object.c:
* libguile/foreign-object.h (scm_make_foreign_object_1)
(scm_make_foreign_object_2, scm_make_foreign_object_3)
(scm_make_foreign_object_n): Change to take void * arguments, and to
add a comment to the header indicating that these are convenience
constructors.
* libguile/foreign-object.c:
* libguile/foreign-object.h (scm_foreign_object_unsigned_ref)
(scm_foreign_object_unsigned_set_x): New functions, equivalent to the
old scm_foreign_object_ref and scm_foreign_object_set_x.
* libguile/foreign-object.c:
* libguile/foreign-object.h (scm_foreign_object_signed_ref)
(scm_foreign_object_signed_set_x): New functions taking
scm_t_signed_bits.
* libguile/foreign-object.c:
* libguile/foreign-object.h (scm_foreign_object_ref)
(scm_foreign_object_set_x): New functions that take void*.
* libguile/goops.c (scm_sys_initialize_object): Refactor initialization
so that we don't ref uninitialized slots before initializing them.
This allows foreign slots, whose initial value is 0, to be initialized
via #:init-form.
* module/oop/goops.scm (@slot-ref, @slot-set!): Remove definitions.
Change callers to use struct-ref and struct-set!. slot-ref and
slot-set! were only marginally more efficient and were much more
dangerous. This change allows the standard accessors to work on
foreign slots; that was not the case before, as the 'u' fields of the
struct were read as if they were 'p' slots.
* module/language/tree-il/compile-glil.scm (lambda): Remove support for
compiling @slot-ref/@slot-set!. These were private to GOOPS.
* test-suite/tests/goops.test ("active-slot"): Update to not expect a
ref before initialization.
("foreign slots"): Add tests.
* libguile/finalizers.h:
* libguile/finalizers.c (run_finalizers_async_thunk): Call the new
scm_run_finalizers helper.
(scm_set_automatic_finalization_enabled, scm_run_finalizers): New
functions.
(scm_init_finalizers): Only set a finalizer notifier if automatic
finalization is enabled.
* doc/ref/libguile-smobs.texi (Garbage Collecting Smobs): Add discussion
of concurrency.
* doc/ref/api-smobs.texi (Smobs): Document new functions.
* libguile/print.c (print_vector_or_weak_vector): New static function.
(iprin1): Use 'print_vector_or_weak_vector' in the vector and weak
vector cases.
* libguile/script.c (realloc0): New helper.
(script_read_arg, scm_get_meta_args): Use realloc0, not realloc.
Signed-off-by: Dmitry Bogatov <KAction@gnu.org>
* libguile/vm-engine.c (make-array): Change to only have
restricted-width operands in the first word. This instruction is
currently unused, however.
* module/system/vm/assembler.scm (assembler):
* module/system/vm/disassembler.scm (disassembler): Disallow
restricted-width operands in tail words.
* libguile/finalizers.h:
* libguile/finalizers.c (run_finalizers_async_thunk)
(finalization_thread_proc): Call the new scm_run_finalizers helper.
(scm_i_finalizer_pre_fork): Only spawn the thread if automatic
finalization is enabled.
(scm_set_automatic_finalization_enabled, scm_run_finalizers): New
functions.
(scm_init_finalizers, scm_init_finalizer_thread): Only set a finalizer
notifier if automatic finalization is enabled.
* doc/ref/libguile-smobs.texi (Garbage Collecting Smobs): Add discussion
of concurrency.
* doc/ref/api-smobs.texi (Smobs): Document new functions.
* libguile/vm.c (vm_error_unbound, vm_error_unbound_fluid): Remove proc
argument. The value in slot 0 is not necessarily the procedure being
applied, after the prelude is done.
* libguile/vm-engine.c (vm_engine): Use LOCAL_REF (0) instead of
SCM_FRAME_PROGRAM, and adapt to above changes.