Commit graph

43 commits

Author SHA1 Message Date
Alex Shinn
f5326fafc3 adding heap-sizes to check distribution of chunk sizes in heap 2015-06-15 21:04:25 +09:00
Alex Shinn
950312f13b adding optional tracking of gc time 2015-06-14 23:03:19 +09:00
Alex Shinn
b4c7a7081d Don't bother resetting weak references if none have been allocated. 2015-06-14 16:58:48 +09:00
Alex Shinn
6db194171e Adding option to disable automatic running of finalizers altogether. 2015-06-14 16:19:55 +09:00
Alex Shinn
f0ee48fc4c Fixing type slot specifications. Report from ilammy in issue #235.
- SEXP_STACK had an off by one sexp_type_field_len_base past the top of stack
- SEXP_EXCEPTION claimed 6 slots but only 5 were present
- sexp_type_struct should have had "dl" slot at end
2015-06-03 21:42:57 +09:00
Alex Shinn
607d70c6a0 When directly incrementing or aligning bytecode pos during code generation,
ensure there is enough space just as when emitting.
2015-05-12 23:03:48 +09:00
Alex Shinn
24a880ad28 Adding fixed-size heaps as an experimental compile-time option. 2015-04-25 22:24:56 +09:00
Alex Shinn
11cb17835b Adding sexp_int32_t definition. Fixing SRFI 27 bug on 32 bit machines.
Fixing the random-integer range to allow all results with a bignum bound.
2015-04-25 13:01:16 +09:00
ilammy
a6ca2e39dc chibi.crypto: move sexp_uintN_t typedefs to <sexp.h>
First we check for C99 support in Makefile.detect, looking for the
header we need and verifying whether it is the right one by using
a definition required by C99 standard to be present in that header.

uintN_t types are optional, but implementations are required to
provide corresponding limit #defines for the types they support,
so we can check for this with preprocessor only.

Finally, we define SEXP_UINTN_DEFINED for any sexp_uintN_t we have
so that the code can use #ifs to check for exact integer support.
2015-04-19 16:01:11 +03:00
Alex Shinn
01df2fec44 Merge pull request #251 from ilammy/overflow-fixes
Fixed a couple of integer overflows
2015-04-15 17:14:58 +09:00
Alex Shinn
4dda923081 Updating copyright years. 2015-04-09 01:28:02 +09:00
ilammy
a1ec8ff493 Avoid overflow when doing sexp_fx_abs()
Naturally, fixed-width integer arithmetics can overflow. Chibi handles
it pretty well in general, but one case was missing: it is negation of
the minimal negative number that can be represented as a fixnum. That is,
sexp_fx_neg() must not be applied to sexp_make_fixnum(SEXP_MIN_FIXNUM)
because it overflows and returns an identical fixnum back.

sexp_fx_neg() itself seems to be used right in the current code, but
sexp_fx_abs()--which is defined in terms of sexp_fx_neg()--could be
applied to the forbidden number when used to retrieve an unboxed value
via the sexp_unbox_fixnum(sexp_fx_abs(x)) pattern. So I have added a
separate macro that safely calculates unboxed absolute value of a fixnum,
and replaced sexp_unbox_fixnum(sexp_fx_abs(x)) usages with it.

Current implementation uses two-bit tag for fixnums, plus we need one
bit for the sign, so fixnums have (machine word - 3) significant bits.
Regression tests cover word sizes of 16, 32, 64, and 128 bits (for the
sake of past- and future-proofness).

sexp_bignum_expt() does not have a regression test because we need to
check it with negative exponents like -2^29, so the base must be over
at least 2^(2^29) for the differences to be visible. Fun fact: bignum
representation of such number takes around 1/32 of the available user-
space memory, which makes testing on anything except 32-bit systems
unreasonable (4 TB of RAM anyone?)
2015-03-26 02:30:48 +02:00
Alex Shinn
447eb20a07 Disabling 2010 epoch by default. 2015-03-03 00:40:02 +09:00
Alex Shinn
692a231091 merge 2015-02-13 19:04:59 +09:00
Alex Shinn
ed4cef9294 Adding sexp_length macro. 2015-02-13 19:02:28 +09:00
Alex Shinn
05294de078 Committing removed files. 2015-02-08 16:02:50 +09:00
Alex Shinn
f54e40547d Adding an abort facility to exit the vm without any exception handling. 2015-02-05 22:09:45 +09:00
Alex Shinn
2922ed591d Forgot to install regexp (patch from Lorenzo) 2015-01-26 08:06:59 +09:00
Alex Shinn
f24eef289c Optimizing string-offset->index. 2015-01-24 12:46:44 +09:00
Alex Shinn
429704a5f6 thread-terminate should set an exception in the thread 2014-12-27 14:51:12 +09:00
Alex Shinn
f869fa7475 Renaming include files as .h. 2014-12-25 13:54:23 +09:00
Alex Shinn
aafc97acc0 Including local source files verbatim in FFI.
Moving huff includes to include dir.
2014-12-25 13:47:24 +09:00
Alex Shinn
14e0b4f6eb Allow linking clibs.c instead of including it. 2014-12-25 13:23:17 +09:00
Alex Shinn
7f3c503dcd Tracking FFI type getters and setters. 2014-12-13 15:17:17 +09:00
Alex Shinn
c0b9a213c9 Adding sexp_apply_no_err_handler utility and using in simplifier. 2014-11-11 22:28:12 +09:00
Alex Shinn
f759076d2b Binding a socket makes it non-blocking by default.
Allowing primitives (currently only send/receive) to block just once
with SEXP_G_IO_BLOCK_ONCE_ERROR.
2014-09-28 16:20:45 +09:00
Alex Shinn
4c5788ff11 Adding missing file from last patch. 2014-09-27 20:54:13 +09:00
Alex Shinn
d1eeea1a66 Adding sexp_bytes_maybe_null_data macro for bytevector FFI support. 2014-08-22 22:40:19 +09:00
Alex Shinn
6f57be54ea Do the right thing for #e1e100.
Yuck, need to rewrite the number parsing.
2014-08-06 22:49:25 +09:00
Alex Shinn
213af9c098 Fixing sexp_context_align_pos when SEXP_USE_ALIGNED_BYTECODE is enabled. 2014-07-31 22:31:33 +09:00
Alex Shinn
3031b50406 Adding build option to print stack traces on segfault. 2014-07-06 21:47:36 +09:00
Alex Shinn
676b39d82a Moving ephemerals into the core. Using them as a weak table to store filenos,
and enforcing the invariant that there is only one fileno object with a given
number at a time.
2014-05-31 14:20:00 +09:00
Alex Shinn
22e2a08563 Fixing custom ports built without utf8 support. 2014-05-08 06:47:33 -04:00
Alex Shinn
ffcf606251 Remove a warning by using #ifndef instead of #if. 2014-05-07 15:06:54 -04:00
Alex Shinn
46a8b11645 Disabling SEXP_USE_SEND_FILE by default. 2014-04-06 22:12:57 +09:00
Alex Shinn
ad83b1b00c Adding sexp_current_input_port(ctx) and sexp_current_output_port(ctx) macros. 2014-03-19 21:54:22 +09:00
Alex Shinn
7727c4c45d Taking a frozen copy of the initial env when we setup the meta env.
This is so that you can import into the interaction env without affecting
the (chibi) module.
2014-03-15 18:49:47 +09:00
Alex Shinn
30178e9c28 Moving meta.scm to meta-7.scm to avoid unintended override.
Addresses issue #214.
2014-03-11 20:46:03 +09:00
Alex Shinn
c45780656c Rename bindings should be the default. 2014-03-10 00:11:05 +09:00
Alex Shinn
01178a8eda Removing conservative bytecode gc. 2014-02-21 00:03:20 +09:00
Alex Shinn
9a50fca274 Merge. 2014-02-20 22:34:34 +09:00
Alex Shinn
8b5eb68238 File descriptors maintain a reference count of ports open on them
They can be close()d explicitly with close-file-descriptor, and
will close() on gc, but only explicitly closing the last port on
them will close the fileno.  Notably needed for network sockets
where we open separate input and output ports on the same socket.
2014-02-20 22:32:50 +09:00
Alex Shinn
610a5d2d8f Optionally conservatively marking bytecode data. 2014-02-19 21:42:45 +09:00