Was never used, so we save having to set it on various ops.
* libguile/arrays.h (SCM_I_ARRAY_FLAG_CONTIGUOUS,
SCM_SET_ARRAY_CONTIGUOUS_FLAG, SCM_CLR_ARRAY_CONTIGUOUS_FLAG,
SCM_I_ARRAY_CONTP): Remove.
* libguile/arrays.c (scm_i_ra_set_contp): Remove. Elsewhere remove all
uses of this and the other macros.
* libguile/arrays.c: Assume the registry of array element types.
* libguile/arrays.h (scm_make_generalized_vector): Last decl from
generalized-vectors.h.
* libguile/generalized-vectors.h:
* libguile/generalized-vectors.c: Remove.
Elsewhere remove references to generalized-vectors.
Nothing is lost in these since the functions already required true typed
vectors, the extra arguments didn't serve any purpose.
Changing my mind from (vec) to (vec, lenp), though. Will fix
vector/bitvector next.
* libguile/srfi-4.h: scm_TYPEvector_(writable_)elements take (vec, lenp).
* libguile/srfi-4.c: Fix implementation.
* libguile/bitvectors.c: Fix use.
* test-suite/standalone/test-srfi-4.c: Fix old test and write variant
with full array handle interface.
* doc/ref/srfi-modules.texi: Fix doc for srfi-4
scm_TYPEvector_(writable_)elements.
Doc fixes & tests TBD.
* libguile/bitvector.h: As stated.
* libguile/bitvector.c: Fix uses of scm_bitvector_elements,
scm_bitvector_writable_elements.
* libguile/array-handle.c: scm_array1_bit_elements,
scm_array1_bit_writable_elements: New functions.
* libguile/array-handle.h: Publish the new functions.
* libguile/posix.c: Fix use of scm_bitvector_elements.
* vectors.h: As stated. Don't include array-handle.h.
* vectors.c (scm_vector_elements, scm_vector_writable_elements):
Reimplement.
(vector-move-right!, vector-move-left!): Replace uses of
scm_vector_elements and scm_vector_writable_elements on array types.
* doc/ref/api-data.texi: Fix doc for scm_vector_elements and
scm_vector_writable_elements.
* libguile/sort.c (stable-sort!): Fix use of
scm_vector_writable_elements.
Just like in dc8dda77e0, this ensures weak
sets are vacuumed in a timely fashion. It also works around the fact
that 'vacuum_all_weak_tables' isn't getting called more than a couple of
times, for some reason.
Partly fixes <https://bugs.gnu.org/40194>.
* libguile/weak-set.c (weak_set_add_x): When 'set->items > set->upper',
call 'vacuum_weak_set'.
* libguile/vectors.c (make_vector): New function.
(scm_c_make_vector): Use it instead of 'scm_words'.
(scm_vector_copy): Use it instead of 'scm_c_make_vector'.
Fixes <https://bugs.gnu.org/21076>.
* libguile/dynl.c (sysdep_dyn_link): Try plain lt_dlopen first, to
interpret fname as a literal path.
* doc/ref/api-foreign.texi: Update explanation to describe the new
behavior.
Co-authored-by: Ludovic Courtès <ludo@gnu.org>
Fixes <https://bugs.gnu.org/40075>.
Reported by Thomas Klausner <tk@giga.or.at>.
* libguile/null-threads.h: Include "libguile/scm.h".
* libguile/null-threads.c: Include "libguile/scmconfig.h".
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
This avoids errors while loading the file when types are not in scope.
* libguile/libguile-3.0-gdb.scm (%gdb-memory-backend)[void*]: Turn into
a promise and adjust user accordingly.
(ip-type, fp-type, sp-type, uint-type): Remove.
(vm-frame)[ip-type, uint-type]: New variables.
Add keyword handling to (hash ...). Previously it would just return the
same value for all keywords.
* libguile/hash.c (scm_raw_ihash): Add scm_tc7_keyword case.
* libguile/keywords.h (SCM_I_KEYWORD_HASH): New macro.
* libguile/vm.c (push_interrupt_frame, compose_continuation): In places
where we push on synthetic frames before possibly going back to mcode,
make sure that the return mcode will trampoline back to the
interpreter. Fixes compose-continuation from the interpreter to
partial continuations with mcode.
* libguile/jit.c (emit_direct_tail_call): Assert self-tail call has
mcode.
(opcodes_seen, bitvector_ref, bitvector_set, compile1): Make the
opcodes_seen set more compact, and log all instruction emissions at
level 3.
(compute_mcode): Don't overwrite mcode if compilation fails.
Suggested by Dale P. Smith <dsmich@roadrunner.com>.
* libguile/deprecated.h (SCM_MEMORY_ERROR): New macro.
* doc/ref/api-control.texi (Dynamic Wind): Use 'scm_report_out_of_memory'.
'scm_memory_error' was deprecated in 2014 in commit
c2247b782a and removed in 2017 in commit
c248ea10be. This is a followup.
* libguile/error.h (SCM_MEMORY_ERROR): Remove.
* doc/guile-api.alist: Remove 'scm_memory_error'.
* doc/ref/api-control.texi (Handling Errors): Likewise.
(Dynamic Wind): Use 'scm_misc_error' instead of 'scm_memory_error'.
This significantly speeds up loads that create lots of bignums, like
(language cps slot-allocation) for files with many top-level
definitions. Compiling such a file is typically 2.5 times faster.
See <https://lists.gnu.org/archive/html/guile-devel/2020-02/msg00023.html>.
* libguile/numbers.c (custom_gmp_malloc): Use
'scm_gc_malloc_pointerless' instead of 'scm_malloc'.
(custom_gmp_realloc): Use 'scm_gc_realloc'.
(custom_gmp_free): Remove call to 'free'.
(make_bignum): Use 'scm_gc_malloc' instead of 'scm_gc_malloc_pointerless'.
Call 'scm_i_set_finalizer' only when SCM_INSTALL_GMP_MEMORY_FUNCTIONS is
false.