Commit graph

7242 commits

Author SHA1 Message Date
Daniel Kochmański
cc27aadf5f clos: ensure correct class stamps
- we did not distinguish between classes that had no slots and classes that
  had no been iniutialized - that led to incorrect class stamps

- structures had no initial class stamp matching their structure

- structures when slot names chagned had their stamp increased despite not
  really changing
2022-02-04 21:31:53 +01:00
Daniel Kochmański
52bfba7a31 cosmetic: remove unused variable 2022-02-04 21:31:53 +01:00
Daniel Kochmański
0782658ea5 tests: cosmetic: muffle excessive compiler output
cmp.0090.funcall/apply-inline-and-number-of-arguments called compile on a
lambda that caused a call to cmperr - that made the console log when testing
cluttered.
2022-02-04 21:28:44 +01:00
Daniel Kochmański
19112f0c95 Merge branch 'branch-cuts' into 'develop'
numbers: be consistent with branch cuts and signed zero

Closes #661

See merge request embeddable-common-lisp/ecl!266
2022-02-04 20:09:05 +00:00
Marius Gerbershagen
8f51683516 printer: don't pretty print stuff in _ecl_write_list
The pretty printer should handle this and we should not pretty print
objects if *pretty-print* is false.

Closes #673.
2022-01-31 21:05:27 +01:00
Marius Gerbershagen
f873e8e653 cmp: check number of arguments when inlining funcall or apply of lambda expression
Closes #672.
2022-01-29 20:21:00 +01:00
Marius Gerbershagen
1c989247c1 bytecmp: use load time forms when needed in the case macro
Closes #669.
2022-01-23 10:37:06 +01:00
Marius Gerbershagen
f3d4cf4b66 cmp: fix specification of integer suffixes for the C compiler
Fixes #667.
2022-01-15 18:11:26 +01:00
Marius Gerbershagen
8da3475b02 numbers: be consistent with branch cuts and signed zero
Let the sign of zero determine from which side branch cuts are
approached, no matter whether we use C99 complex numbers or not.

Disable the (acosh -∞) test. This test fails with the new code, but
was supposed to be commented out anyway. In general, we don't
guarantee anything about infinity if complex numbers are involved.

Closes #661.
2022-01-09 15:01:04 +01:00
Marius Gerbershagen
ef94137e3d Merge branch 'fix-various' into 'develop'
restart-case: conformance fix: more precise keyword parsing

Closes #666

See merge request embeddable-common-lisp/ecl!265
2022-01-06 14:09:48 +00:00
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
0660996c37 mp: semaphores: add tests and the documentation
Functions wait-on-semaphore and try-get-semaphore are deprecated in
favour of the new function.
2022-01-06 09:32:49 +01:00
Daniel Kochmański
bf62cd9d40 mp: semaphores: add a new function semaphore-wait
This function offers a functionality similar to sbcl, namely allows
specifying the timeout and the resource count.
2021-12-23 12:09:57 +01:00
Daniel Kochmański
e83f278f17 doc: fix typos 2021-12-23 10:42:59 +01: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
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
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
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
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