We can't use the standard functions like cl_list for allocating the
wrapper object for the finalizer since these need a working environment
for disabling interrupts.
We also need the interrupt_struct in the fake env to allow explicitely
checking for interrupts on platforms where this doesn't happen implicitely
by using mprotect.
Always use the byte sized input/output operations ReadConsoleA/WriteConsoleA
and do all the conversion to unicode by ourself.
Moreover, expand the set of known encodings for Windows codepages and print
a warning if we encounter an unsupported codepage.
Fixes#582.
We need to compile the function body in the same environment in which
the function was defined. However the function arguments need to be
compiled in the current argument.
Fixes#577.
Unify handling of LAMBDA and LAMBDA-BLOCK in c1funcall and c1apply,
split off computation of let bindings and body in
optimize-funcall/apply-lambda into a separate function.
Preliminary work to fix inlining of local closures.
This is more consistent with other streams for which file-position
doesn't make sense, which also just return nil instead of signaling
errors.
Fixes#580.
We can't use ecl_process_env_unsafe() == NULL to check if ECL has
booted because the return value of ecl_process_env_unsafe is
unpredictable before ECL has booted. The reason is that
ecl_process_env_unsafe calls pthread_getspecific with an uninitialized
key stored in cl_env_key. But another call to pthread_setspecific
might have already registered a key which happens to be the same as
the not yet initialized cl_env_key, yielding a non-NULL value.
Only call handlers established in the current thread and use atomic
operations to update *descriptor-handlers*.
Closes#588.
Additionally:
- improve the test code
- add a test for the leak
- provide internet machine link for the tutorial
That makes lambda with a declaration si:function-block-name behave
consistently with ext:lambda-block (and in eval-macros
ext:lambda-block expands to have this declaration too to behave in
turn consistently with how the compiler treats ext:lambda-block).
Recursive locks may be determined from the object header while reading
the counter is wrong, because at a time of testing with the CV counter
may be exactly 1 despite the fact that the lock is recursive.
If getrlimit fails, new_size may be zero. Furthermore, getrlimit may also return
RLIM_INFINITY in which case new_size is way to large. In both cases the real stack size is
unknown and we can only use some sensible default.
The ifdef in config-internal.h was buggy since RLIMIT_STACK is only defined after
sys/resource.h has been included which it wasn't. This lead to the stack size always being
increased to at least the default of 1 MB. To fix this, we move the check for RLIMIT_STACK
to the configure script.
this is needed e.g. for constructions like
for (int i,...); by default some compilers in older Linux
systems, eg Ubuntu Trusty, still default to C89, giving a build error.
This fix will try to make sure that C99 is used, with an extra option.
We can't use the ECL_WITH_SPINLOCK_BEGIN/END macros since they check
for pending interrupts at the end of their unwind-protect frame. This
leads to various bugs:
- in queue_signal the to be queued interrupt is executed immediately
after being queued even if interrupts are disabled
- in pop_signal if multiple interrupts are queued they are executed in
reverse order
To fix these issues, use a) ecl_get/giveup_spinlock directly and b)
ecl_disable/enable_interrupts_env to prevent the spinlock not being
released due to an interrupt happening during the execution of the
main body of pop_signal/queue_signal.
We need to save env->nvalues before calling cl_set on any variable
because cl_set overwrites env->nvalues. Otherwise, we only get nil for
any variable after the first special one.
Fixes#591.