A lot of code was duplicated due to creating descriptors for output,
input and error streams. It is reduced by extracting function
`create_descriptor'.
Signed-off-by: Daniel Kochmański <dkochmanski@turtle-solutions.eu>
This makes `stderr` same class citizen as `stdout` and `stdin`. In
order to make it work structure process has been changed to be able to
handle stream_error and index of `exit-code` and `status` are
1+. Access to stream is possible via last value of run-program, which
returns process itself.
Signed-off-by: Daniel Kochmański <dkochmanski@turtle-solutions.eu>
Order of checking the same conditions in input and output was slighly
different without an obvious reason. Fixed that, so code is easier to
read.
Signed-off-by: Daniel Kochmański <dkochmanski@turtle-solutions.eu>
If `rlimit' is available (ie on linux), then don't extend stack above
maximum value. If we don't know limit or limit is `infinity', then
there is no protection and user extends heap on his own risk.
Signed-off-by: Daniel Kochmański <dkochmanski@turtle-solutions.eu>
Now `si:set-limit' calculates size by itself, while `*_set_size' sets
size as name says. Extend `c-stack' by magnitude of two.
Signed-off-by: Daniel Kochmański <dkochmanski@turtle-solutions.eu>
Add `serror' and `stack-error-handler', which behave like normal
`cerror' -> `universal-error-handler' call order, except fact, that
after handling stack-overflow condition they reset appropriate stack
limit. Fixes#56.
Signed-off-by: Daniel Kochmański <dkochmanski@turtle-solutions.eu>
When stack overflow condition is risen, to throw cerror stack limit
has to be raised by pre-allocated margin. This function resets stack
limit to original value. The only argument is stack designator.
Signed-off-by: Daniel Kochmański <dkochmanski@turtle-solutions.eu>
It is different from stack size, because limit is space available to
user, while stack size is larger by safe_area necessary to act on
stack overflow conditions.
Signed-off-by: Daniel Kochmański <dkochmanski@turtle-solutions.eu>
Some functions were setting size of stack to provided value, while
other added (* 2 margin) to it, what wasn't consistant. Now each
function treats provided size as a limit and adds margin to it.
Signed-off-by: Daniel Kochmański <dkochmanski@turtle-solutions.eu>
Documentation explicitly mentions this nickname, and it's common for
many implementations. Closes#72.
Signed-off-by: Daniel Kochmański <dkochmanski@turtle-solutions.eu>
This is required because format is working on string with fill pointer
making it an array - not simple-array what is expected.
Signed-off-by: Daniel Kochmański <dkochmanski@turtle-solutions.eu>
Removes coercion to base-string and improves some use cases. Due to
recent change in double-quote reader (conformity fix), now type of
each read string is (simple-array character (*)), so when pathnames
were created, it were copying it to (simple-array base-char (*)), lead
to buggy results. Consider:
(let ((path
(let ((x "foo"))
(make-pathname :name x :type x))))
(eql (pathname-name path)
(pathname-type path))) ; => T
Before change, this construct was returning NIL, what in case of
serialization might be a problem, and wasn't `the right thing`® to do.
Signed-off-by: Daniel Kochmański <dkochmanski@turtle-solutions.eu>
Additional sanity checks and bugfixes in case of providing extended
strings to character low-level functions.
Signed-off-by: Daniel Kochmański <dkochmanski@turtle-solutions.eu>
If directory is of type (simple-array character(*)), then coerce it to
(simple-array base-char (*)) instead of throwing an error.
Signed-off-by: Daniel Kochmański <dkochmanski@turtle-solutions.eu>
Due to mistake, ext::make-encoding was pointing to si_make_encoding,
but si_make_encoding was calling ext::make-encoding, what caused
infinite recursion when building for windows, when codepage was
different then Latin-1.
CLHS mandates that failure to determine or set the file position on a
stream should be signalled by returning NIL rather than raising an error.
Also, POSIX does not mandate that lseek fail on terminals, but these devices
obviously are not seekable. Hence, CLHS compliance is improved by explicitly
returning NIL when the requested stream is a tty.
Patch is necessary to implement this function in cffi - a few libraries
depends on this functionality, and until now it throws an error.
Signed-off-by: Daniel Kochmanski <dkochmanski@hellsgate.pl>
In general, any function declared with the 'ecl_attr_noreturn'
attribute might need to be defined to call __coverity_panic__() here.
See: https://scan.coverity.com/tune
When the EQL specializer is a class it may clash with a class
specializer, since the class specializer is cached as a class object.
Use twice as much space for cache, the cache entry itself and a bit, 1
if it's an eql-specializer, 0 if it's a class specializer.
Fixes#295
RUNEs and RODs are not compatible with the result
of (RUNES:RUNE), because that returns (STRING ...), and
(TYPE-OF "Σ") has CHARACTERS, but
(TYPE-OF "a") "only" BASE-CHARs ...
At least CLISP, ABCL, SBCL return the same value for both
TYPE-OF forms above.
- HAVE_GC_SET_START_CALLBACK was defined unconditionally
- there was no AC_DEFINE if system_boehm was false
- there was a typo in one usage site of this macro
see 6b754564f1
Its lambda-list should be (generic-function &rest function-arguments), not
(generic-function function-arguments).
Its value should be returned at the call site of the generic function.
Fixes#278.