Commit graph

8180 commits

Author SHA1 Message Date
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
Marius Gerbershagen
8a38c9a3c2 remove register storage class specifier
This option is not needed anymore, ignored by modern compilers and has
been removed in the C++17 standard.

Fixes #647.
2021-07-17 12:13:05 +02:00
Marius Gerbershagen
ed0c3843ba Merge branch 'compiler-improvements' into 'develop'
cmp: major cleanup, separate passes

See merge request embeddable-common-lisp/ecl!251
2021-07-17 09:25:26 +00:00
Daniel Kochmański
e68e682784 Merge branch 'add-ed-hooks' into 'develop'
Add ed hooks

See merge request embeddable-common-lisp/ecl!253
2021-07-01 16:17:45 +00:00
Tarn W. Burton
cb750d37d6 Add tests and documentation for ed hooks 2021-07-01 11:17:08 -04:00
Tarn W. Burton
c0e56f23af Add ed hooks 2021-07-01 11:15:05 -04:00
Daniel Kochmański
080da44821 Merge branch 'cdr-6' into 'develop'
Add CDR 6 feature keyword

See merge request embeddable-common-lisp/ecl!255
2021-07-01 12:47:40 +00:00
Daniel Kochmański
eacc5a25fb cmp: cosmetic: remove the file notes.org
Information there is not up to date and may confuse a reader.
2021-07-01 14:14:53 +02:00
Daniel Kochmański
a70c2fa36c cmp: ctop-write: don't reverse *static-constants* twice
This was probably a braino. *static-constants* is always a list.
2021-07-01 14:14:53 +02:00
Daniel Kochmański
7efb01d7d1 cmp: separate type propagation pass
The type propagation is invoked with a function compiler-pass/propagate-types
before the compiler-pass2. Previously the type propagation was invoked in
ctop-write.
2021-07-01 14:14:36 +02:00
Daniel Kochmański
8716c62f6d cmp: p1fset type propagator returns FUNCTION
Previously the propagator incorrectly returned the type of the function lambda.
2021-07-01 14:11:33 +02:00
Daniel Kochmański
e4fca7e8e7 cmp: separate fun/var ir functions from passes
Also provide better load grouping.
2021-07-01 14:11:33 +02:00
Daniel Kochmański
c8c59167d0 cmp: major cleanup, separate passes
- separate passes

  The separation is not fine-grained but is a good starting point for further
  cleanup. This is a preliminary requirement for multiple backends.

- use uninternet symbol in the package definition

- remove "execute" permission from all files

- remove a few unused functions

- rearrange loaded files

- less verbose compiler

  Don't print "End of pass 1." message. This doesn't provide any valuable
  information to the programmer.
2021-07-01 14:11:33 +02:00
Tarn W. Burton
3d09bebe62 Add CDR 6 feature keyword 2021-07-01 07:44:14 -04:00
Daniel Kochmański
0aa627e3e7 Merge branch 'finalizer-cycles' into 'develop'
gc: call finalizer for builtin object only when the object is truly unreachable

See merge request embeddable-common-lisp/ecl!252
2021-06-12 20:38:41 +00:00
Marius Gerbershagen
0638932696 run-program: remove redundant finalizer for windows handles
We have already registered a finalizer for the external process object
which calls external-process-wait. This in turn calls si::waitpid
which closes the handle once the process has exited.
2021-06-12 21:26:47 +02:00
Marius Gerbershagen
ddb7bb72e9 gc: call finalizer for builtin object only when the object is truly unreachable
Otherwise it can happen that a user-defined finalizer for some object
A storing a builtin object B registers another finalizer for A making
B reachable again while B has already been finalized.

We can't impose an ordering for user-defined finalizers in general
since these may include cyclic references. Therefore it is the duty of
the user to write the finalizers in a consistent way which is
independent of the order in which the finalizers are called. This
doesn't work for builtin objects since the user can't influence
the finalizers in this case.

We also fix a bug which lead to the removal of the standard finalizer
if a user-defined finalizer was registered and then removed.

Co-authored-by: Daniel Kochmański <daniel@turtleware.eu>
2021-06-12 21:26:47 +02:00
Daniel Kochmański
76f700a86d Merge branch 'develop' into 'develop'
modern macOS does not need libm.dylib, nor has it

See merge request embeddable-common-lisp/ecl!254
2021-06-10 14:06:56 +00:00
Dima Pasechnik
a58106e207 more details added, and examples adjusted 2021-06-10 14:33:08 +01:00
Dima Pasechnik
5e99481bd3 modern macOS does not need libm.dylib, nor has it 2021-06-10 13:41:56 +01:00
Marius Gerbershagen
e5d8336379 Merge branch 'fix-direct-superclasses' into 'develop'
direct-superclasses: the default value of the slot is nil per AMOP

See merge request embeddable-common-lisp/ecl!239
2021-05-15 17:21:02 +00:00
Daniel Kochmański
e881e5fa86 tests: add missing validate-superclass methods to a few MOP tests 2021-05-10 13:36:01 +02:00
Daniel Kochmański
0e5174c040 direct-superclasses: the default value of the slot is nil per AMOP
http://metamodular.com/CLOS-MOP/class-direct-superclasses.html
2021-05-10 13:23:56 +02:00
Daniel Kochmański
086ec59ab8 check-direct-superclasses: handle forward-referenced-class
The forward-referenced-class metaclass has no superclasses.

Moreover:

- check superclasses after they are added (removes one fixme)
- don't map validate-superclass during clos booting
2021-05-10 13:23:56 +02:00
Daniel Kochmański
178e0362e3 Merge branch 'update-ucd' into 'develop'
Update the unicode character database

See merge request embeddable-common-lisp/ecl!250
2021-05-10 10:35:50 +00:00
Marius Gerbershagen
5a4c337bd5 char_ctype.d: use new ucd.h header features instead of hardcoded constants 2021-05-07 21:09:09 +02:00
Marius Gerbershagen
ecd86a2541 unicode: update unicode character database to version 13.0.0 2021-05-07 21:09:09 +02:00
Marius Gerbershagen
8350f07100 contrib/unicode: improve ucd table generating code
Provide some comments on what the code is doing.

Increase size of integers used in encoding pairs of consecutive words
(needed to encode the current ucd).

Introduce additional bidirectional classes.

Provide new ucd.h header with enums for general-category and
bidirectional class.

Add update-ucd.sh script to automate the updating process.
2021-05-07 21:09:08 +02:00