Commit graph

7510 commits

Author SHA1 Message Date
Marius Gerbershagen
a34b6d0ca4 threading: proctect with-rwlock against interrupts 2018-09-18 18:45:41 +02:00
Daniel Kochmański
c301009424 Merge branch 'revert-cleanup-up' into 'develop'
Revert "cmp: execute cleanup forms of unwind-protect with interrupts disabled"

See merge request embeddable-common-lisp/ecl!119
2018-09-17 15:20:20 +00:00
Marius Gerbershagen
3824e1b6da doc: fix documentation for mp:without-interrupts 2018-09-15 19:59:06 +02:00
Marius Gerbershagen
198f051369 export with-restored-interrupts from mp package 2018-09-15 19:54:51 +02:00
Marius Gerbershagen
95b0523bfe top.lsp: make with-grabbed-console interrupt safe 2018-09-15 19:53:42 +02:00
Marius Gerbershagen
b5194ca774 threading: fix interrupt safety of out_of_memory function
This function used writes in the thread local environment while
    interrupts where disabled with the env->disable_interrupts
    mechanism, which causes problems with the mprotect() mechanism for
    fast interrupt dispatch.
2018-09-09 17:06:32 +02:00
Marius Gerbershagen
57f6637902 threading: introduce thread safe ECL_UNWIND_PROTECT macro and use where needed
Disabling interrupts during execution of cleanup forms of
    unwind-protect caused problems in some cases. Hence only do this
    where needed, i.e. for freeing resources (such as locks or files)
    shared between multiple threads or processes.
2018-09-09 17:00:38 +02:00
Marius Gerbershagen
dfd24e45c5 Revert "threading: block interrupts during execution of cleanup forms in unwind-protect"
This reverts commit 24e4c13d58.
2018-09-08 17:46:55 +02:00
Daniel Kochmanski
703771fc3d Revert "cmp: execute cleanup forms of unwind-protect with interrupts disabled"
This reverts commit b8df7a777c.
2018-09-04 17:53:30 +02:00
Daniel Kochmański
3adc8b2219 Merge branch 'read-bclosure' into 'develop'
fix reading of bclosures

See merge request embeddable-common-lisp/ecl!118
2018-09-04 15:53:05 +00:00
Marius Gerbershagen
30fa0cd7a5 reader: fix do_patch_sharp for bclosures
do_patch_sharp was erroneously returning only the bytecode,
    stripping away the lexical environment.
2018-09-01 17:32:45 +02:00
Marius Gerbershagen
741a01da09 reader: fix reading of bclosures
The syntax had been changed in commit
    991bc3ab78, but the reader macro
    became broken in the process and commit
    835e85bc99 removed the broken
    parts. Since the reason for the change in the syntax is unclear,
    go back to the old syntax.
2018-09-01 17:31:19 +02:00
Marius Gerbershagen
ba6e6ddde7 reader: don't treat -. and +. as a number
CLHS section 2.3.1 mandates that all numbers must contain at least
    one digit. Fixes #427.
2018-08-23 22:55:23 +02:00
Marius Gerbershagen
3201b545e1 reader: don't allow a package prefix in an uninterned symbol
Fixes #439.
2018-08-21 20:08:00 +02:00
marcinkolenda419
4f392ddbe2 examples: add cmake example 2018-08-17 10:45:02 +02:00
Daniel Kochmański
3b84b388b2 Merge branch 'mk_rsym_deprec' into 'develop'
rm `rsym` from util Makefile -- rsym.c doesn't exist

See merge request embeddable-common-lisp/ecl!114
2018-08-10 10:01:07 +00:00
Marcin Kolenda
f9b371ddbf rm rsym from util Makefile -- rsym.c doesn't exist
Checked with ack-grep if it isn't mentioned in other places - it isn't.

Looked in repo history what is rsym.c - haven't found anything
2018-08-10 07:53:25 +02:00
Daniel Kochmanski
768eb27079 Remove "copyright" from examples/
Examples were relicensed (under permission from JJGR) to BSD-2-Clause a few
years back. We also remove Copyright from individual files to match the
convention that examples doesn't have that (whole codebase is under JJGR's
copyright too).
2018-08-10 07:36:02 +02:00
Marius Gerbershagen
a7353369ea threading: faster interrupt safe frame/binding stack manipulations
Only use one memory barrier for pushing in the frame/binding stack
    and ensure interrupt safety by saving/restoring the stack frame in
    which writes could happen during an interrupt.
2018-08-04 17:21:16 +02:00
Marius Gerbershagen
319b7ef79b doc: document :object and :long-double ffi types 2018-07-29 15:41:20 +02:00
Marius Gerbershagen
abd4e66f48 stop ecl_frs_push from setting frs_val to often
The following code `(LOOP (BLOCK NIL (RETURN)))` would produce an
    error. ecl_frs_push would correctly set __frame->frs_val the first
    time, however later on control would jump to the statement after
    ecl_setjmp and __frame->frs_val would be set again, this time to a
    wrong value. Fixes #446.
    Also, we don't need to pass val to _ecl_frs_push anymore, so this
    argument has been removed.
2018-07-22 11:10:22 +02:00
Daniel Kochmański
572cd5ee6f Merge branch 'develop' into 'develop'
try fix ecl_open_stream on windows

See merge request embeddable-common-lisp/ecl!112
2018-07-22 08:21:44 +00:00
Yuguo Zhang
5db3a78208 ecl_open_stream, close invalid fd cause crash on windows platform.
actually, the build process will terminated when loading
cmp/cmpos-features.lsp

related function is:

(with-open-file (s fc :direction :output :if-exists :overwrite
                      :if-does-not-exists :create)

it's a MS feature called security-enhanced CRT.
2018-07-22 14:12:59 +08:00
Yuguo Zhang
2283656b24 ecl_open_stream: treat new file as exists after been created. 2018-07-10 09:26:30 +08:00
Marius Gerbershagen
a3e1cf7c78 cmp: correctly restore compile-file(-pathname) in ext:install-c-compiler
After a call to ext:install-c-compiler while the bytecodes compiler
    is installed, compile-file and compile-file-pathname still point
    to bc-compile-file and bc-compile-file-pathname. Reported and
    fixed by gitlab user pouar. Fixes #444.
2018-07-08 17:33:09 +02:00
Marius Gerbershagen
aad6d252d6 tests: fix embedding tests on mingw
We need to set the path environment variable for the test programs to
    find ecl.dll
2018-07-07 22:16:50 +02:00
Marius Gerbershagen
2ad7cef5dd fix exit code of processes in si_waitpid on windows
GetExitCodeProcess returns the exit code in a DWORD, which is an
    unsigned integer, however main functions usually return a signed int, so
    we need put in an explicit type cast.
2018-07-07 22:16:50 +02:00
Marius Gerbershagen
fb643f6b0f buildsystem: fix building for mingw64
mingw64 also defines __MINGW32__ and sets the host system type to
    be x86_64-w64-mingw32, so we only need to change the way we detect this
    in aclocal.m4.
2018-07-07 22:16:49 +02:00
Marius Gerbershagen
442b41241f add :wsock to *features*
This is needed internally in mislib.lsp.
2018-07-07 22:16:15 +02:00
Daniel Kochmański
d595f98a5b Merge branch 'fix-429-compile-closure' into 'develop'
Fix #429

Closes #429

See merge request embeddable-common-lisp/ecl!110
2018-07-04 14:58:57 +00:00
Marius Gerbershagen
b56c9c12be doc: fix section about the interpreter lexical environment 2018-06-24 15:48:09 +02:00
Marius Gerbershagen
3bd980ce43 bytecmp: improve closure generation for macros
Only close around functions and variables when actually needed.
    Reverse changes to compiler environment, since we need the
    bytecode and native compiler environemnts to be
    similar (si::eval-with-env is called in the native compiler with
    its own compiler environment, so having symbol macros both
    c_env->variables and c_env->macros could be problematic).
2018-06-24 15:47:55 +02:00
Marius Gerbershagen
25a72ff80a cosmetic: indentation fixes and some comments 2018-06-23 21:37:26 +02:00
Marius Gerbershagen
d27f1494e1 cmp: fix compile call for closures
Signal an error for compilation of cclosures. Allow for
    compilation of bclosures over macros, functions and variables.
    Macros are simply added to the compiler environment. For functions
    and variables we enclose the definition of the closure in
    appropiate let/flet forms, e.g. for `(lambda () (fun var))'
    closing over the function `fun' and variable `var':
    (let ((var ...))
      (flet ((fun (x) ...))
        (lambda () (fun var))))
    Closures over tags and blocks are not implemented and will signal
    an error during compilation.
2018-06-23 21:37:26 +02:00
Marius Gerbershagen
b0a7684f2f bytecmp: Allow compilation of closures over macros
Change lexenv to include local macro definitions at the end of the
    lexenv list. If a function is defined in a non-nil macro
    environment, a bclosure is created during compilation which has as
    its lexenv only the macros it closes over. During interpretation,
    ecl_close_around adds to this the variables, functions, blocks
    and tags the function also closes over.
    Also close over symbol macros.
2018-06-23 21:37:25 +02:00
Marius Gerbershagen
c7a0b753c9 bytecmp: fix compilation of closures
Extract function name for bclosures in guess_environment and
    signal an error when attempting to compile a cclosure
2018-06-23 21:37:15 +02:00
Marius Gerbershagen
4a20aa14f4 reader: signal error on invalid macro dispatch characters
Before the recent changes to be more ANSI compliant
    with *read-suppress* (commit
    07391b9ced),
    dispatch_macro_character would complain that no dispatch function
    was defined. Now we explicitely signal an error.
2018-06-16 15:26:38 +02:00
Marius Gerbershagen
4d3df3766b printer: fix printing of string input streams
Currently ECL crashes because we did not set the array element
    type for the stack allocated tag. Use the string pool instead.
    This should be plenty fast enough, since the performance of
    printing of string input streams is not important anyway.
2018-06-16 13:04:49 +02:00
Marius Gerbershagen
4e02997d79 printer/reader: call user defined write/read-sequence methods for CLOS streams
Before this change, we called user defined write-string methods
    directly in write-string/write-line but all other operations were
    done inefficiently through generic_write/read_vector.
2018-06-06 22:32:22 +02:00
Marius Gerbershagen
706847293d printer: use si_do_write_sequence in recently optimized printing routines
We don't need cl_write_string, since the CLOS stuff inside there
    is just for optimization. Improves performance for ANSI streams.
2018-06-05 21:30:29 +02:00
Marius Gerbershagen
25e1417dac doc: add dictionary for extensions to ANSI streams 2018-06-01 21:56:40 +02:00
Marius Gerbershagen
dff75dc004 cmp: push the generic function name in the IHS for CLOS methods
Makes debugging easier, since now the backtrace prints the correct
    generic function name instead of some symbol generated by gensym.
2018-05-31 19:48:48 +02:00
Marius Gerbershagen
65524e01d8 add changelog entry for removed sigaltstack option 2018-05-30 18:35:40 +02:00
Marius Gerbershagen
fd62dc11f8 threading: be more interrupt safe with thread local variables in environment
Also add some comments and use the right interrupt disabling
    mechanism in get_aux_stream.
2018-05-27 20:57:50 +02:00
Marius Gerbershagen
9f8adbbe4e remove unused (sig)altstack option
This functionality has been removed long ago with commit
    1472cc91ef.
2018-05-27 20:30:22 +02:00
Marius Gerbershagen
fd1affa7d0 Print a C backtrace in ecl_thread_internal_error
After the recent changes to the C backtrace interface,
    _ecl_dump_c_backtrace() no longer needs a working lisp
    environment, so we can safely call it here.
2018-05-27 18:21:30 +02:00
Marius Gerbershagen
861e798cd3 Correctly report if variables are bound or not in si_bds_val
For thread local bindings, ECL_NO_TL_BINDING is used to signal an
    unbound variable. Fixes error from #325.
2018-05-27 17:33:48 +02:00
Daniel Kochmański
5de18683ac Merge branch 'develop' into 'develop'
Fix for #403

Closes #403

See merge request embeddable-common-lisp/ecl!109
2018-05-25 05:11:26 +00:00
Marius Gerbershagen
2c135e798b printer: fix the recently optimized printing routines
Overflows of the string buffer were not correctly handled.
2018-05-23 22:13:15 +02:00
Marius Gerbershagen
5f621c6e96 printer: use the string pool to optimize more printing routines 2018-05-14 22:20:44 +02:00