Commit graph

8207 commits

Author SHA1 Message Date
Daniel Kochmański
e82d002f90 restart-case: conformance fix: more precise keyword parsing
- don't assume that any keyword is an option
- don't process the same keyword twice

New behavior could be summarized in these two cases:

(restart-case t
  (retry ()
    :retired ; <- form
))

(restart-case t
  (retry ()
    :report report  ; <- expression
    :report "foo"   ; <- form
    :test test      ; <- form
))

Fixes #666.
2022-01-06 09:51:40 +01:00
Daniel Kochmański
e83f278f17 doc: fix typos 2021-12-23 10:42:59 +01:00
Daniel Kochmański
0a5a49ab45 Merge branch 'develop' into 'develop'
msvc: set HAVE_WCHAR_H in config.h

See merge request embeddable-common-lisp/ecl!263
2021-12-23 09:39:44 +00:00
Yuguo Zhang
6b0f6faa55 msvc: set HAVE_WCHAR_H in config.h 2021-12-23 09:39:44 +00:00
Daniel Kochmański
8ffe6e8116 Merge branch 'gray-real-column' into 'develop'
Allow real-valued columns in various Gray stream methods

See merge request embeddable-common-lisp/ecl!264
2021-12-23 09:38:51 +00:00
Tarn W. Burton
130e0d8806 Update changelog and tests for real-valued columns in Gray methods 2021-12-21 10:05:33 -05:00
Tarn W. Burton
d778112a34 Allow real-valued columns in Gray methods 2021-12-21 10:04:56 -05:00
Daniel Kochmański
66ec96b08c Merge branch 'develop' into 'develop'
cmpos-features: fix command line arguments for msvc

See merge request embeddable-common-lisp/ecl!262
2021-12-01 15:20:07 +00:00
Yuguo Zhang
e279df5d77 cmpos-features: fix command line arguments for msvc 2021-12-01 15:20:07 +00:00
Kevin Zheng
4cb2b51dfe manual: document the exported ffi ecl_ functions
Fixes #611.

Co-authored-by: Daniel Kochmański <daniel@turtleware.eu>
2021-11-22 08:45:42 +01:00
Daniel Kochmański
6aa02de4c4 compiler: better checking whether a variable may be introduced
Previously c1make-var checked whether the symbol NAME is CONSTANTP, but
ECL expands symbol macros in CONSTANTP so this returned false positives.
A similar concern applied to the CMP-ENV-REGISTER-SYMBOL-MACRO-FUNCTION.

C1EXPR-INNER when encountered a symbol tried to yield C1CONSTANT-VALUE
for if it iwas CONSTANTP - this was correct except for that we didn't
pass the environment to the predicate and symbols weren't shadowed.

In this commit one function is added to the core - si:constp (with
similar purpose to si:specialp) and one function to the compiler -
constant-variable-p (similar to special-variable-p) and they are
appropriately used when necessary. A regression test is added.

Fixes #662.
2021-11-19 11:56:23 +01:00
Daniel Kochmański
de1b587d78 define-compiler-macro: fix the documentation expansion
Previously it set the documentation slot for the function - it should do
it for the compiler-macro. Fixes #658.
2021-11-06 09:34:25 +01:00
Daniel Kochmański
1c7ca7acc5 Merge branch 'develop' into 'develop'
src/c/Makefile.in: Respect LDFLAGS for dpp

See merge request embeddable-common-lisp/ecl!261
2021-11-06 08:29:12 +00:00
Ulrich Müller
4bedbc44fb src/c/Makefile.in: Respect LDFLAGS for dpp 2021-11-05 12:36:46 +01:00
Daniel Kochmański
48041ec274 Merge branch 'native-mutex' into develop 2021-10-19 09:30:15 +02:00
Daniel Kochmański
acc9b2a2a6 Merge branch 'wscl-type-error' into 'develop'
Signal type-error in condition readers

See merge request embeddable-common-lisp/ecl!259
2021-10-16 16:43:52 +00:00
Tarn W. Burton
10947989ed Update changelog and add tests for condition readers 2021-10-05 05:46:37 -04:00
Tarn W. Burton
bc0e2dbf99 Add reader type errors for WSCL conformance 2021-10-05 05:46:29 -04:00
Marius Gerbershagen
ae6cd30e9e floating point exceptions: add workaround for incomplete fenv.h headers
Fixes #653.
2021-09-19 17:30:35 +02:00
Marius Gerbershagen
c82780622c external-formats: fix several typos in utf16 de/encoders 2021-09-04 17:52:33 +02:00
Marius Gerbershagen
4f3dc42ef6 time.d: allow for interrupts during (sleep) on Windows
There's little reason for not doing so and on Unix systems one can
already interrupt sleeping threads.
2021-08-29 17:25:21 +02:00
Marius Gerbershagen
5f65deea5b multithreading: implement optional timeout for mp:get-lock 2021-08-29 17:25:21 +02:00
Marius Gerbershagen
806336ed2e multithreading: read-write-lock improvements
Read-write locks are always provided; if no operating system
primitives exist, emulate them using ordinary locks. Also provide a
Windows implementation.
2021-08-29 17:25:21 +02:00
Marius Gerbershagen
de5d56b4c6 multithreading: replace various synchronization objects by native mutexes
- Spinlocks have been replaced by ordinary locks. Without access to
  the underyling scheduler, spinlocks provide no performace benefit
  and may even be harmful in case of high contention.
- Synchronization of process creation and exiting has been simplified.
  Instead of a spinlock, a barrier and atomic operations we now use
  only a single lock protecting the shared process state and a
  condition variable for implementing process joins.
- Some locks which were implemented using Lisp objects now directly
  use a native mutex.
- Our own mutex implementation has been removed as it is now unused.
2021-08-29 17:23:20 +02:00
Marius Gerbershagen
23a7ade20c multithreading: implement mailboxes using native mutexes
The old implementation was not race condition free. If two threads (A
and B) were writing at the same time while one thread (C) was reading,
the following could happen:

1. thread A increases the write pointer (but does not store the
   message yet)
2. thread B increases the write pointer, stores the message and
   signals thread C
3. thread C tries to read from the location that thread A has not yet
   written to

The new implementation is a simple and obvious solution using a common
mutex and two condition variables for reading/writing. We don't bother
with a (complex) interrupt safe implementation.
2021-08-29 17:23:20 +02:00
Marius Gerbershagen
968083738a multithreading: implement semaphores using native mutexes 2021-08-29 17:23:20 +02:00
Marius Gerbershagen
b332f2c592 multithreading: implement barriers using native mutexes 2021-08-29 17:23:20 +02:00
Marius Gerbershagen
579a8d4380 run-program: simplify with-process-lock
We already have a race condition between mp:get-lock and
mp:holding-lock-p, there is no point in trying to make sure the lock
is released at all costs during an interrupt.
2021-08-29 17:23:19 +02:00
Marius Gerbershagen
2dce0dabdb doc: multithreading: clarify restrictions for mutex functions 2021-08-29 17:23:19 +02:00
Marius Gerbershagen
61098a1009 tests: multiprocessing: add tests for condition variables 2021-08-29 17:23:19 +02:00
Marius Gerbershagen
43befa3b59 tests: multiprocessing: major overhaul
Changes include:
- consistent naming
- replaced unnecessary use of (sleep) by better synchronization mechanisms
- tests are run with timeouts
- clean up stray threads which would otherwise wait for all eternity
- better error messages in case of test failures
2021-08-29 17:23:19 +02:00
Marius Gerbershagen
a5762b4a76 tests: 2am-ecl: implement timeouts for tests
Add new macro test-with-timeout, refactor various global variables
for test statistics into a struct.
2021-08-29 17:23:19 +02:00
Marius Gerbershagen
0f737b6ba6 multithreading: implement mutexes and condition variables using OS primitives
Replace slow homegrown mutex implementation by standard OS functions.

We try our best to be interrupt safe, however a completely safe
implementation is impossible (unless one completely removes the ability
to interrupt a thread waiting on a mutex). There is always a window
after the OS specific function has returned, but before we can set
the owner, in which interrupts will see an inconsistent state of the
mutex with regards to owner and count.

Condition variables are now based on OS functions as well. Timed
waiting on condition variables has also been implemented.
2021-08-29 17:23:19 +02:00
Daniel Kochmański
25495bce6c Merge branch 'develop' into 'develop'
doc: cosmetic fixes

See merge request embeddable-common-lisp/ecl!256
2021-08-20 10:45:22 +00:00
Daniel Kochmański
5524a227f6 Merge branch 'pathname-encoding' into 'develop'
Handle non-ascii characters in pathnames

Closes #549 and #609

See merge request embeddable-common-lisp/ecl!258
2021-08-20 10:44:46 +00:00
Daniel Kochmański
89fd8c53f4 Merge branch 'string-extensions' into 'develop'
Extend API for converting strings to and from different encodings

See merge request embeddable-common-lisp/ecl!257
2021-08-20 10:34:56 +00:00
Marius Gerbershagen
7431e6941c msvc: Makefile: use file stream instead of input stream for compile.lsp
Be consistent with unix Makefile, allow for debugging errors during the build.
2021-08-19 14:00:28 +02:00
Marius Gerbershagen
b98752cda1 tests: add tests for correct handling of unicode characters in pathnames 2021-08-19 14:00:28 +02:00
Marius Gerbershagen
ff8cf4d3c1 pathnames: handle unicode characters
On Unix, pathnames are converted into the default encoding specified
by ext:*default-external-format* and back. On Windows, the operating
system already gives us utf16 encoded pathnames, so we use those.

ecl_namestring with ECL_NAMESTRING_FORCE_BASE_STRING encodes with the
specified encoding. Decoding is handled individually in the filesystem
functions.

Includes a minor refactor of list_directory, changing the
PARSE_DIRECTORY_ENTRY macro into an inline function.

Closes #609, #549.
2021-08-19 14:00:28 +02:00
Marius Gerbershagen
57f1597d86 doc: document ext:*default-external-format* 2021-08-19 13:51:55 +02:00
Marius Gerbershagen
a488595241 add convenience methods for de-/encoding strings and wide-strings from C 2021-08-19 13:51:55 +02:00
Marius Gerbershagen
548309e165 cmdline options: also set ext::*default-external-format* when --encoding is given 2021-08-19 13:51:55 +02:00
Marius Gerbershagen
d528d5445b sequence-streams: handle utf16/32 encodings for vectors with 16/32 bit sized element-types 2021-08-19 13:51:55 +02:00
Marius Gerbershagen
55af7bae85 strings: add functions to encode/decode strings into byte sequences
API copied from sbcl.
2021-08-19 13:51:55 +02:00
Yuguo Zhang
4b2437947b doc: cosmetic fixes 2021-08-16 12:31:57 +08:00
Daniel Kochmański
a8b1c0da43 bytecmp: load correctly cancatanated fasc files (2)
This commit complements the previous one by ensuring that concatenated files are
read in order (after processing previous files) and that we don't check whether
packages are created before we process all files.
2021-08-13 14:39:10 +02:00
Daniel Kochmański
fbb75a0fc5 bytecmp: load correctly cancatanated fasc files
The manual claims that fasc files may be concatanated and the result will be
loadable. Fixes #649.
2021-08-13 09:48:27 +02:00
Marius Gerbershagen
b9a3d859e9 doc: fix ecl_symbol_value declaration 2021-08-09 15:29:04 +02:00
Marius Gerbershagen
43be4f6d3e put si_make_backq_vector declaration in external.h
This function can be found in lisp code (it is generated by the reader
from backquotes), thus it must be declared in external.h so that the C
compiler can pick it up when we compile the generated C file.

Fixes #648.
2021-08-01 15:33:03 +02:00
Daniel Kochmański
31a515a16d doc: fix a typo in enumarated symbol names
:*int??-t was misspelled as :*int??_t.
2021-07-26 12:57:33 +02:00