| Commit message (Expand) | Author | Age | Files | Lines |
* | loader: Handle interned constants as well as plain bytevectors....This is a follow-up to commit b04e79283ada9a6af05552dda6446a0934c0fbe2.
* libguile/loader.c (scm_load_thunk_from_memory): Extract constants only
if the object is a pair.
| Ricardo Wurmus | 2020-05-17 | 1 | -6/+15 |
* | guile-snarf fix...(Best-ability ChangeLog annotation added by Christopher Allan Webber.)
* libguile/guile-snarf.in (modern_snarf): Adjusted.
| Robin Templeton | 2020-04-04 | 1 | -1/+2 |
* | multiple obarrays...* libguile/symbols.c (lookup_uninterned_symbol)
(lookup_interned_latin1_symbol, lookup_interned_utf8_symbol)
(scm_i_str2symbol): Take an `obarray' argument. All callers changed.
(scm_make_obarray, scm_find_symbol, scm_intern, scm_unintern)
(scm_obarray_for_each): New functions.
| BT Templeton | 2020-04-04 | 2 | -16/+87 |
* | intern arbitrary constants...(Best-ability ChangeLog annotation added by Christopher Allan Webber.)
* libguile/loader.c (load_thunk_from_memory): Refactor, adding
"constants" argument and passing to "init" if appropriate.
(load_thunk_from_file): Call "load-thunk-from-memory" with
"constants" set to #f.
(scm_load_thunk_from_memory): Instead of a bytevector, accept
a cons of "(bytevector . constants)", where constants is either
a vector or #f. Pass this into "load_thunk_from_memory".
* module/language/bytecode/spec.scm: Adapt printer.
* module/language/cps/compile-bytecode.scm (compile-bytecode):
New variable.
* module/system/repl/command.scm (disassemble):
Adapt to expect pair which includes bytevector as its car.
* module/system/vm/assembler.scm <asm>: Add "to-file?" slot.
(fresh-block): New variable.
(make-assembler): Adapt to expect "to-file?" keyword argument.
(intern-constant): Support "asm-to-file?" in checks.
(emit-init-constants, link-data): Likewise.
(link-assembly): Update logic for handling "(bytevector . constants)"
pair, as well as the expectations of its invocation by compile-bytecode.
| Robin Templeton | 2020-04-04 | 1 | -6/+17 |
* | Remove CFLAGS from snarfcppopts....libguile/Makefile.am (snarfcppopts): Remove CFLAGS
| Robin Templeton | 2020-04-04 | 1 | -1/+1 |
* | Revert "Fix build on platforms where the stack grows upwards."...This patch was only meant to apply to the 3.0 branch.
| Andy Wingo | 2020-03-13 | 1 | -1/+1 |
* | Fix build on platforms where the stack grows upwards.... * libguile/continuations.c (scm_dynthrow): Fix missing mra
parameter to grow_stack for SCM_STACK_GROWS_UP.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
| John Paul Adrian Glaubitz | 2020-02-12 | 1 | -1/+1 |
* | Handle GMP allocations through libgc and remove bignum finalizers....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.
| Ludovic Courtès | 2020-02-12 | 1 | -7/+12 |
* | Respect thread local fluid defaults...Previously (fluid-ref (make-thread-local-fluid #t)) would return #f via
scm_fluid_ref because the internal scm_hashq_ref would return #f when
the fluid had not been set, and that was interpreted as an actual value
for the fluid.
Instead, just pass the fluid default as the default for the hash table
lookups so that we don't need a second step to determine if the fluid
was set.
Thanks to Andrew Gierth for tracking down the problem.
| Rob Browning | 2020-01-12 | 1 | -14/+9 |
* | Fix non-deterministic crash in 'finalization_thread_proc'....Fixes <https://bugs.gnu.org/37757>.
Reported by Jesse Gibbons <jgibbons2357@gmail.com>.
* libguile/finalizers.c (finalization_thread_proc): Do not enter the
"switch (data.byte)" condition when data.n <= 0.
| Ludovic Courtès | 2019-12-09 | 1 | -13/+18 |
* | ports: 'scm_port_poll' honors "w" flags....Fixes <https://bugs.gnu.org/36709>.
Reported by Mark H Weaver <mhw@netris.org>.
* libguile/ports.c (scm_port_poll): Replace second POLLIN by POLLOUT.
| Ludovic Courtès | 2019-11-18 | 1 | -1/+1 |
* | 'strftime' and 'strptime' honor the locale encoding....Fixes <https://bugs.gnu.org/35920>.
Reported by Christopher Lam <christopher.lck@gmail.com>.
* libguile/stime.c (scm_strftime): Use 'scm_to_locale_stringn' instead
of 'scm_to_utf8_stringn'.
(scm_strptime): Likewise, and use 'scm_string_length' instead of
'u8_strnlen'.
* test-suite/tests/time.test ("strftime")["strftime passes wide
characters"]: Wrap body in 'with-locale'.
["strftime fr_FR.utf8", "strftime fr_FR.iso88591"]: New tests.
("strptime")["strftime fr_FR.utf8", "strftime fr_FR.iso88591"]: New
tests.
| Ludovic Courtès | 2019-06-30 | 1 | -12/+12 |
* | Remove references to 'inet-ntoa' and 'inet-aton'....These procedures were removed in Guile 2.2 by commit
fc7bd367ab4b5027a7f80686b1e229c62e43c90b (May 2011).
* libguile/socket.h (scm_inet_aton, scm_inet_ntoa): Remove.
* module/system/repl/server.scm (make-tcp-server-socket): Use
'inet-pton' instead of 'inet-aton'.
* doc/ref/web.texi (HTTP): Likewise in 'declare-header!' example.
* doc/ref/posix.texi (Network Address Conversion): Remove documentation
of 'inet-ntoa' and 'inet-aton'.
| Ludovic Courtès | 2019-06-24 | 1 | -3/+1 |
* | Copy terminating zero in 'scm_cat_path'....* libguile/script.c (scm_cat_path): Pass N + 1, not N, to 'strncat'.
Reported by GCC 9.1.0.
| Ludovic Courtès | 2019-06-20 | 1 | -2/+2 |
* | srfi-14: Fix possible buffer overrun in '%char-set-dump'....* libguile/srfi-14.c (scm_sys_char_set_dump): Change array size from 9
to 11 as suggested by GCC 9.1.0.
| Ludovic Courtès | 2019-06-20 | 1 | -1/+1 |
* | Rename 'scm_c_make_char' to 'scm_i_make_char'....* libguile/chars.c, libguile/chars.h, libguile/ports.c,
libguile/print.c, libguile/read.c, libguile/srfi-13.c,
libguile/strings.c, libguile/vm-engine.c: Rename 'scm_c_make_char' to
'scm_i_make_char'.
| Mark H Weaver | 2019-06-18 | 8 | -34/+34 |
* | fport_seek: Eliminate a fruitless use of 'off_t_or_off64_t'....This is a followup to commit 91ba73b397fcc2a36ae7e434522a924c7a8887d0.
* libguile/fports.c (fport_seek): Use 'lseek' instead of
'lseek_or_lseek64', and use 'scm_t_off' uniformly. That's the type used
in the function signature, and there's no benefit to using a wider type
internally. Remove the overflow check, which is no longer needed.
| Mark H Weaver | 2019-06-18 | 1 | -7/+2 |
* | open-process: Fix dup(2) and execvp(2) error handling....Previously, in the case where OUT is 0, or ERR is 0 or 1,
e.g. when (current-error-port) points to STDOUT, the code in
'start_child' to relocate OUT/ERR out of the way to another file
descriptor had multiple bugs:
(1) It neglected to close the original file descriptor.
(2) It checked 'errno' without first checking the return value of
dup(2). This doesn't work because dup(2) leaves 'errno' unchanged
if there's no error.
(3) In case 'errno' contained EINTR, the retry code failed because
OUT (or ERR) was overwritten by the result of the previous failed
dup(2) call.
This commit fixes these problems, as well as another problem with
'execvp' error reporting.
* libguile/posix.c (renumber_file_descriptor): New static helper
function.
(start_child): Use 'renumber_file_descriptor'. If 'execvp' fails, write
the error message to file descriptor 2. Previously, we wrote the error
message to ERR, which was the old file descriptor before being relocated
to 2.
| Mark H Weaver | 2019-06-18 | 1 | -9/+38 |
* | Refresh a stale comment....* libguile/numbers.h: In a comment, update the count of number subtypes.
| Mark H Weaver | 2019-06-18 | 1 | -1/+1 |
* | scm_mkstrport: Optimize the POS -> BYTE_POS conversion....* libguile/strports.c (scm_mkstrport): Use 'scm_c_string_utf8_length' to
avoid the conversion to UTF-8.
| Mark H Weaver | 2019-06-18 | 1 | -2/+2 |
* | Add get-bytevector-some!....* libguile/r6rs-ports.c (scm_get_bytevector_some_x): New procedure.
* libguile/r6rs-ports.h (scm_get_bytevector_some_x): Add prototype.
(scm_unget_bytevector): Move prototype next to 'scm_get_bytevector_some_x'.
* module/ice-9/binary-ports.scm: Export 'get-bytevector-some!'.
* doc/ref/api-io.texi (Binary I/O): Document it.
| Mark H Weaver | 2019-06-18 | 2 | -2/+48 |
* | scm_to_stringn: Avoid passing NULL to c_strcasecmp....Reported by Massimiliano Gubinelli <m.gubinelli@gmail.com> in
<https://lists.gnu.org/archive/html/guile-user/2019-05/msg00070.html>.
* libguile/strings.c (scm_to_stringn): Check for (encoding == NULL)
before passing it to 'c_strcasecmp'. Eliminate redundant 'enc'
variable.
| Mark H Weaver | 2019-06-18 | 1 | -6/+5 |
* | Fix typo in tags.h comment....* libguile/tags.h: Fix typo in comment.
| Mark H Weaver | 2019-06-18 | 1 | -1/+1 |
* | Save and restore errno in the signal handler....* libguile/scmsigs.c (take_signal): Save and restore errno.
| Mark H Weaver | 2019-06-18 | 1 | -0/+2 |
* | Improve overflow checks in bytevector, string, and I/O operations....* libguile/bytevectors.c (INTEGER_ACCESSOR_PROLOGUE)
(scm_bytevector_copy_x, bytevector_large_set): Rewrite checks to reliably
detect overflows.
(make_bytevector): Constrain the bytevector length to avoid later
overflows during allocation.
(make_bytevector_from_buffer): Fix indentation.
(scm_bytevector_length): Use 'scm_from_size_t' to convert a 'size_t',
not 'scm_from_uint'.
* libguile/fports.c (fport_seek): Check for overflow before the implicit
conversion of the return value.
* libguile/guardians.c (guardian_print): Use 'scm_from_ulong' to convert
an 'unsigned long', not 'scm_from_uint'.
* libguile/ports.c (scm_unread_string): Change a variable to type 'size_t'.
(scm_seek, scm_truncate_file): Use 'scm_t_off' instead of
'off_t_or_off64_t' to avoid implicit type conversions that could
overflow, because 'ptob->seek' and 'ptob->truncate' use 'scm_t_off'.
* libguile/r6rs-ports.c (bytevector_input_port_seek)
(custom_binary_port_seek, bytevector_output_port_seek): Rewrite offset
calculations to reliably detect overflows. Use 'scm_from_off_t' to
convert a 'scm_t_off', not 'scm_from_long' nor 'scm_from_int'.
(scm_get_bytevector_n_x, scm_get_bytevector_all, scm_unget_bytevector)
(bytevector_output_port_write): Rewrite checks to reliably detect
overflows. Use 'size_t' where appropriate.
(bytevector_output_port_buffer_grow): Rewrite size calculations to
reliably detect overflows. Minor change in the calculation of the new
size: now it is max(min_size, 2*current_size), whereas previously it
would multiply current_size by the smallest power of 2 needed to surpass
min_size.
* libguile/strings.c (make_stringbuf): Constrain the stringbuf length to
avoid later overflows during allocation.
(scm_string_append): Change overflow check to use INT_ADD_OVERFLOW.
* libguile/strports.c (string_port_write): Rewrite size calculations to
reliably detect overflows.
(string_port_seek): Rewrite offset calculations to reliably detect
overflows. Use 'scm_from_off_t' to convert a 'scm_t_off', not
'scm_from_long'.
(string_port_truncate): Use 'scm_from_off_t' to convert a 'scm_t_off',
not 'scm_from_off_t_or_off64_t'.
* libguile/vectors.c (scm_c_make_vector): Change a variable to type
'size_t'.
| Mark H Weaver | 2019-06-18 | 8 | -76/+142 |
* | 'basename' correctly handles "/" and "//"....* libguile/filesys.c (scm_basename): Special-case "/" and "//".
* test-suite/tests/filesys.test ("basename"): New test prefix.
| Ludovic Courtès | 2019-06-04 | 1 | -4/+13 |
* | Strings, i18n: Limit the use of alloca to approximately 8 kilobytes....* libguile/i18n.c (SCM_MAX_ALLOCA): New macro.
(SCM_STRING_TO_U32_BUF): Accept an additional variable to remember
whether we used malloc to allocate the buffer. Use malloc if the
allocation size is greater than SCM_MAX_ALLOCA.
(SCM_CLEANUP_U32_BUF): New macro.
(compare_u32_strings, compare_u32_strings_ci, str_to_case): Adapt.
* libguile/strings.c (SCM_MAX_ALLOCA): New macro.
(normalize_str, unistring_escapes_to_r6rs_escapes): Use malloc if the
allocation size is greater than SCM_MAX_ALLOCA.
* test-suite/tests/i18n.test, test-suite/tests/strings.test: Add tests.
| Mark H Weaver | 2019-05-07 | 2 | -36/+79 |
* | put-u8: Always write a single byte, regardless of the port encoding....Previously, 'put-u8' used textual I/O to write a single character,
relying on the usual practice of setting the port encoding to ISO-8859-1
for binary ports.
* libguile/r6rs-ports.c (scm_put_u8): Use 'scm_c_write', not 'scm_putc'.
| Mark H Weaver | 2019-05-07 | 1 | -1/+1 |
* | Optimize fixnum exact integer square roots....* libguile/numbers.c (scm_exact_integer_sqrt, scm_sqrt)
(exact_integer_is_perfect_square, exact_integer_floor_square_root):
Where it is trivial to do so, use GMP's low-level mpn functions to
avoid heap allocation.
| Mark H Weaver | 2019-05-07 | 1 | -32/+41 |
* | Fix indentation in scm_sum. | Mark H Weaver | 2019-05-07 | 1 | -67/+68 |
* | Fix typo in comment. | Mark H Weaver | 2019-05-07 | 1 | -1/+1 |
* | Add 'scm_c_make_char' and use it where appropriate....This reverts the change to SCM_MAKE_CHAR made in the previous commit
63818453ad226cd3c2d1fd8ade12e3d7c1d43c05, which used an arithmetic trick
to avoid evaluating its argument more than once.
Here, we restore the previous implementation of SCM_MAKE_CHAR, which
evaluates its argument twice. Instead, we introduce a new inlinable
function 'scm_c_make_char' and replace uses of SCM_MAKE_CHAR with calls
to 'scm_c_make_char' where appropriate.
* libguile/chars.h (scm_c_make_char): New inline function.
* libguile/inline.c: Include chars.h.
* libguile/srfi-13.c (REF_IN_CHARSET, scm_string_any, scm_string_every)
(scm_string_trim, scm_string_trim_right, scm_string_trim_both)
(scm_string_index, scm_string_index_right, scm_string_skip)
(scm_string_skip_right, scm_string_count, string_titlecase_x)
(string_reverse_x, scm_string_fold, scm_string_fold_right)
(scm_string_for_each, scm_string_filter, scm_string_delete):
Use 'scm_c_make_char' instead of 'SCM_MAKE_CHAR' in cases where the
argument calls a function.
* libguile/chars.c (scm_char_upcase, scm_char_downcase, scm_char_titlecase),
libguile/ports.c (scm_port_decode_char),
libguile/print.c (scm_simple_format),
libguile/read.c (scm_read_character),
libguile/strings.c (scm_string_ref, scm_c_string_ref),
libguile/vm-engine.c ("string-ref"): Ditto.
| Mark H Weaver | 2019-05-07 | 9 | -47/+59 |
* | Reimplement SCM_MAKE_CHAR to evaluate its argument only once....The motivation for this change is that SCM_MAKE_CHAR is sometimes passed
an expression that involves a procedure call that is not always trivial.
In other cases, the results are not guaranteed to be the same both
times, which could lead to the creation of invalid SCM objects.
* libguile/chars.h (SCM_MAKE_CHAR): Reimplement.
| Mark H Weaver | 2019-04-17 | 1 | -9/+12 |
* | Fix gc.test "after-gc-hook gets called" failures....* libguile/scmsigs.c (signal_delivery_thread): Call scm_async_tick to
give any pending asyncs a chance to run before we block indefinitely
waiting for a signal to arrive.
| Andrea Azzarone | 2019-04-16 | 1 | -0/+8 |
* | Avoid passing NULL to 'memcpy' and 'memcmp'....Reported by Jeffrey Walton <noloader@gmail.com> in
<https://lists.gnu.org/archive/html/guile-devel/2019-03/msg00001.html>.
Note that C11 section 7.1.4 (Use of library functions) states that:
"unless explicitly stated otherwise in the detailed descriptions [of
library functions] that follow: If an argument to a function has an
invalid value (such as ... a null pointer ...) ..., the behavior is
undefined." Note that 'strxfrm' is an example of a standard C function
that explicitly states otherwise, allowing NULL to be passed in the
first argument if the size argument is zero, but no similar allowance is
specified for 'memcpy' or 'memcmp'.
* libguile/bytevectors.c (scm_uniform_array_to_bytevector): Call memcpy
only if 'byte_len' is non-zero.
* libguile/srfi-14.c (charsets_equal): Call memcmp only if the number of
ranges is non-zero.
* libguile/stime.c (setzone): Pass 1-character buffer to
'scm_to_locale_stringbuf', instead of NULL.
* libguile/strings.c (scm_to_locale_stringbuf): Call memcpy only if the
number of bytes to copy is non-zero.
| Mark H Weaver | 2019-04-16 | 4 | -7/+24 |
* | Remove vestigial comment in tags.h....* libguile/tags.h: Remove a vestigial comment which seems to have been
separated from its associated code long ago.
| Mark H Weaver | 2019-04-16 | 1 | -6/+1 |
* | Handle newlib C library's langinfo constant names...The newlib C library (used in Cygwin) has alternative names for
nl_langinfo GNU extensions
* configure.ac (_NL_NUMERIC_GROUPING): new test
* libguile/i18n.c (INT_CURR_SYMBOL, MON_DECIMAL_POINT, MON_THOUSANDS_SEP)
(MON_GROUPING, POSITIVE_SIGN, NEGATIVE_SIGN, GROUPING, INT_FRAC_DIGITS)
(FRAC_DIGITS, P_CS_PRECEDES, P_SEP_BY_SPACE, N_CS_PRECEDES, N_SEP_BY_SPACE)
(P_SIGN_POSN, N_SIGN_POSN, INT_P_CS_PRECEDES, INT_P_SEP_BY_SPACE)
(INT_N_CS_PRECEDES, INT_N_SEP_BY_SPACE, INT_P_SIGN_POSN, INT_N_SIGN_POSN)
[HAVE_DECL__NL_NUMERIC_GROUPING]: map to newlib C constants, when present
| Michael Gran | 2019-02-23 | 1 | -1/+26 |
* | Fix binary output on files created by mkstemp!...Some operating systems require a O_BINARY flag.
* libguile/filesys.c (scm_i_mkstemp): Don't mask out O_BINARY flag
* test-suite/tests/posix.test ("binary mode honored"): new test
| Mike Gran | 2019-02-09 | 1 | -4/+4 |
* | Fix strftime compile with null threads...* libguile/stime.c (scm_strftime): use correct pthread lock function
| Mike Gran | 2019-02-09 | 1 | -2/+2 |
* | Do not warn the user when 'madvise' returns ENOSYS....* libguile/vm.c (return_unused_stack_to_os): Avoid 'perror' calls when
'madvise' returns ENOSYS.
| Ludovic Courtès | 2018-12-16 | 1 | -2/+5 |
* | scm_seed_to_random_state: Support wide string arguments....Partially fixes <https://bugs.gnu.org/33044>.
Reported by Tom de Vries <tdevries@suse.de>.
* libguile/random.c (scm_seed_to_random_state): Use 'scm_to_utf8_string'
(or 'scm_to_latin1_string' for a narrow string, for compatibility) to
convert the string into raw bytes for use by 'scm_c_make_rstate'. Make
sure the length in bytes fits within an 'int'.
| Mark H Weaver | 2018-10-19 | 1 | -2/+24 |
* | Fix typo in strings.h....* libguile/strings.h: In a comment, add the missing "i_" in
"scm_i_is_narrow_string".
| Mark H Weaver | 2018-10-19 | 1 | -2/+2 |
* | Use 'scm_from_utf8_{string,symbol,keyword}' for C string literals....Partial fix for <https://bugs.gnu.org/33044>.
Reported by Tom de Vries <tdevries@suse.de>.
Fix several instances of the mistake of using 'scm_from_locale_*' for C
strings that originally came from a C string literal. Change several
uses of 'scm_from_latin1_*' as well, to promote the practice of writing
code that works for arbitrary C string literals.
Also add missing years to the copyright notices of changed files, based
on the git history.
* libguile/debug-malloc.c, libguile/deprecation.c, libguile/error.c,
libguile/eval.c, libguile/expand.c, libguile/extensions.c,
libguile/filesys.c, libguile/init.c, libguile/load.c,
libguile/modules.c, libguile/pairs.c, libguile/posix.c,
libguile/print.c, libguile/random.c, libguile/read.c,
libguile/regex-posix.c, libguile/snarf.h, libguile/srfi-13.c,
libguile/stacks.c, libguile/stime.c, libguile/strports.c,
libguile/values.c: Use 'scm_from_utf8_*' where appropriate.
| Mark H Weaver | 2018-10-17 | 22 | -102/+115 |
* | In 'ash' and 'round-ash', handle right shift count of LONG_MIN....Fixes <https://bugs.gnu.org/21901>.
Reported by Zefram <zefram@fysh.org>.
* libguile/numbers.c: Add another top-level 'verify' to ensure that
LONG_MIN is not a fixnum.
(scm_ash, scm_round_ash): Ensure that when the shift count is LONG_MIN,
it is not handled via the normal code path, to avoid signed overflow
when the shift count is negated.
* test-suite/tests/numbers.test: Add tests.
| Mark H Weaver | 2018-10-14 | 1 | -2/+11 |
* | Fix 'round-ash' of negative integers by huge right shift counts....This is a followup to commit 011aec7e240ef987931548d90c53e6692c85d01c.
When rounding, right shifting a negative integer by a huge shift count
results in 0, not -1.
* libguile/numbers.c: Add top-level 'verify' to ensure that the
assumptions in 'scm_ash' and 'scm_round_ash' are valid.
(scm_round_ash): In the case that handles huge right shifts, require
that the shift count _exceeds_ the integer length, and return 0 instead
of -1.
* test-suite/tests/numbers.test: Adjust tests accordingly.
| Mark H Weaver | 2018-10-14 | 1 | -6/+10 |
* | Gracefully handle huge shift counts in 'ash' and 'round-ash'....Fixes <https://bugs.gnu.org/32644>.
Reported by Stefan Israelsson Tampe <stefan.itampe@gmail.com>.
The need for this arose because the type inferrer for 'ursh' sometimes
passes (- 1 (expt 2 64)) as the second argument to 'ash'.
* libguile/numbers.c (scm_ash, scm_round_ash): Gracefully handle several
cases where the shift count does not fit in a C 'long'.
* test-suite/tests/numbers.test: Add tests.
| Mark H Weaver | 2018-10-14 | 1 | -3/+31 |
* | Fix list validation of *list->bytevector procedures....Fixes <https://bugs.gnu.org/32938>.
Reported by Josh Datko <jbd@cryptotronix.com>.
* libguile/validate.h (SCM_VALIDATE_LIST_COPYLEN)
(SCM_VALIDATE_NONEMPTYLIST_COPYLEN): Use '!=' instead of '>=' to
validate the result of 'scm_ilength' after it has been stored in
the user variable 'cvar'.
* test-suite/tests/bytevectors.test: Add tests. Use '#:use-module'
instead of ':use-module' in 'define-module' form.
| Mark H Weaver | 2018-10-14 | 1 | -4/+8 |
* | Improve the documentation for 'nil?'....* libguile/boolean.c (scm_nil_p): Improve docstring.
* doc/ref/api-languages.texi (Nil): Add documentation for 'nil?', along
with a description of how Elisp interprets Scheme booleans and
end-of-list.
| Mark H Weaver | 2018-10-14 | 1 | -2/+11 |
* | Fix 32/64 bit bug in INTEGER_ACCESSOR_PROLOGUE | Daniel Llorens | 2018-10-10 | 1 | -1/+1 |
* | Fix 'atomic-box-compare-and-swap!'....Fixes <https://bugs.gnu.org/32786>.
'scm_atomic_compare_and_swap_scm' is a thin wrapper around
'atomic_compare_exchange_weak' (where available), and therefore it may
spuriously fail on some platforms, leaving the atomic object unchanged
even when the observed value is equal to the expected value. Since
'scm_atomic_compare_and_swap_scm' returns both a boolean result and the
observed value, the caller is able to detect spurious failures when
using that API.
'atomic-box-compare-and-swap!' presents a simpler API, returning only
the observed value. The documentation advises callers to assume that
the exchange succeeded if the observed value is 'eq?' to the expected
value. It's therefore not possible to report spurious failures with
this API.
'atomic-box-compare-and-swap!' uses 'scm_atomic_compare_and_swap_scm',
and prior to this commit would simply ignore the boolean result and
return the observed value. In case of spurious failures, the caller
would legitimately conclude that the exchange had succeeded.
With this commit, 'atomic-box-compare-and-swap!' now retries in case of
spurious failures.
* libguile/atomic.c (scm_atomic_box_compare_and_swap_x): If
'scm_atomic_compare_and_swap_scm' returns false and the observed value
is equal to 'expected', then try again.
* libguile/vm-engine.c (atomic-box-compare-and-swap!): Ditto.
| Mark H Weaver | 2018-10-05 | 2 | -9/+29 |