The result of `mktime` is -1 for an error. The result is also -1 if
the time is 1 second before the epoch. That's not useful, so ignore
it.
original commit: aa8ca31cef223128fd8ed1abdc76beb31a0e077a
The MRG32k3a generator is fast when using unboxed floating-point
arithemtic. Since the Scheme compiler doesn't yet support that,
build MRG32k3a into the kernel and provide access via
`pseudo-random-generator` functions.
original commit: 3dd74679a6c2705440488d8c07c47852eb50a94b
If normal 1-shot continuations are mixed with opportunistic 1-shot
continuations created by `call-setting-continuation-attachment`, then
promoting an opportunistic 1-shot at a GC is wrong unless the whole
chain is promoted.
original commit: 2dfac475666763b60935e382386af4438f3029e0
Also, rename `call-with-current-continuation-attachment` to
`call-getting-continuation-attachment`.
original commit: e2a00e6d641b92918c4911c27ba14949748fd291
Add a shortcut check when refiying the continuation frame in tail
position, which is significantly cheaper when the frame is already
there. We pay down the check by skipping an attachment-lists check
that is not needed if the frame is newly reified.
Aslo, add a one-shot continuation-frame cache, which makes a shallow
temporary attachment cheaper, as in
(let loop ([i N])
(if (zero? i)
0
(loop (call-setting-continuation-attachment
i
(lambda ()
(f (sub1 i)))))))
The cache is just one frame. Keeping a chain of allocated-by-not-GCed
frames doesn't pay off.
Meanwhile, remove the leftover `$shift-attachment` library entry.
original commit: 1f454f536b1d7efe20fe9e793cda31e54e31e5f4
Weak pairs, ephemeron pairs, some symbols, and some ports were handled
incorerctly when locked multiple times.
original commit: 847fc1c84496f67cd363c8411d0023339f4d6246
The `unlock-object` operation was O(N) with N currently locked objects
--- so, O(N^2) to lock N objects and then unlock them --- because
locked objects were stored in and searched in a global list. Also, GC
was O(N) at any generation with N locked objects across generations,
since every locked object was scanned.
Fix these poblems so that locking and unlocking is practically O(1)
and GC is not poportional to locked objects. More precisely, locking
and unlocking is now O(C) for locking an individual object C times to
be balanced by C unlocks. (Since multiple locks on a single object
is rare, this performance seems good enough.)
The implementation replaces the global list with segment-specific
lists. Backpointers are managed using the general generational
support, so that unmodified, old-generation locked objects do not
need to be swept duing a new-generation collection.
original commit: a57d256ca73a3d507792c471facb7e35afbe88b3
p is a pointer that iterates over path, which is buffer.
We should not try to get to an address preceding its start.
Since there was an execution path that leads to that,
guard against it with an additional check.
Signed-off-by: Alexander Shopov <ash@kambanaria.org>
original commit: de8d0e742f44c80735a682bd05019246c2087d56
Move `NORETURN` of 2e3a618b00 to start of function declaration, where
it works for both GCC and MSVC.
original commit: 10fc4a2406ecd34fa686d9d643ee63d7c12d6f97
Merging ".o" files to one "kernel.o" can be convenient for further
linking, but it requires running `ld` directly. Running `ld` directly
sometimes runs into a mismatch between the C compiler and the default
`ld`. It's better to use the more typical approach of collecting
objects into an archive.
original commit: 7d5b60c7566570655e567495d86d546101cf8fb4
Use OSSP UUID on {Free,Open}BSD and native UUID on NetBSD.
Building on OpenBSD requires a filesystem mounted with wxneeded.
original commit: e964d7d01a6d115e469c01626896b683d421d599
A few shift lefts cause ub because of `(1 << n)` where `n` is 31.
The constant 1 is signed causing ub. Initially my fix was to do `(1U << n)` however, I have seen the pattern `((U32)1 << n)` elsewhere in the file so decided to follow this.
Caught by ubsan racketcs.
original commit: a902c9ab67010f521f786e2027d4e197d78975a4
According to ubsan we get several times into undefined behaviour due to signed overflow:
foreign.c:91:21: runtime error: signed integer overflow: 3291370622602663862 * 3 cannot be represented in type 'long int'
This happens only when the symbol name is relatively large like as for the call:
symhash (s=0x5555558caab8 "(cs)set_enable_object_backreferences")
original commit: 1e1c91869443d8a22beeebfcbe6fa14f9c3e2a6e
On a 64-bit platform, the test for "short" arguments to
avoid overflow was incorrect, because `(- (expt 2 30))`
counted as short.
original commit: 6d05b70e86987c0e7a07f221ba5def492300aaaf
- added compress-level parameter to select a compression level for
file writing and changed the default for lz4 compression to do a
better job compressing. finished splitting glz input routines
apart from glz output routines and did a bit of other restructuring.
removed gzxfile struct-as-bytevector wrapper and moved its fd
into glzFile. moved DEACTIVATE to before glzdopen_input calls
in S_new_open_input_fd and S_compress_input_fd, since glzdopen_input
reads from the file and could block. the compress format and now
level are now recorded directly the thread context. replaced
as-gz? flag bit in compressed bytevector header word with a small
number of bits recording the compression format at the bottom of
the header word. flushed a couple of bytevector compression mats
that depended on the old representation. (these last few changes
should make adding new compression formats easier.) added
s-directory build options to choose whether to compress and, if
so, the format and level.
compress-io.h, compress-io.c, new-io.c, equates.h, system.h,
scheme.c, gc.c,
io.ss, cmacros.ss, back.ss, bytevector.ss, primdata.ss, s/Mf-base,
io.ms, mat.ss, bytevector.ms, root-experr*,
release_notes.stex, io.stex, system.stex, objects.stex
- improved the effectiveness of LZ4 boot-file compression to within
15% of gzip by increasing the lz4 output-port in_buffer size to
1<<18. With the previous size (1<<14) LZ4-compressed boot files
were about 50% larger. set the lz4 input-port in_buffer and
out_buffer sizes to 1<<12 and 1<<14. there's no clear win at
present for larger input-port buffer sizes.
compress-io.c
- To reduce the memory hit for the increased output-port in_buffer
size and the corresponding increase in computed out_buffer size,
one output-side out_buffer is now allocated (lazily) per thread
and stored in the thread context. The other buffers are now
directly a part of the lz4File_out and lz4File_in structures
rather than allocated separately.
compress-io.c, scheme.c, gc.c,
cmacros.ss
- split out the buffer emit code from glzwrite_lz4 into a
separate glzemit_lz4 helper that is now also used by gzclose
so we can avoid dealing with a NULL buffer in glzwrite_lz4.
glzwrite_lz4 also uses it to writing large buffers directly and
avoid the memcpy.
compress-io.c
- replaced lz4File_out and lz4File_in mode enumeration with the
compress format and inputp boolean. using switch to check and
raising exceptions for unexpected values to further simplify
adding new compression formats in the future.
compress-io.c
- replaced the never-defined struct lz4File pointer in glzFile
union with the more specific struct lz4File_in_r and Lz4File_out_r
pointers.
compress-io.h, compress-io.c
- added free of lz4 structures to gzclose. also changed file-close
logic generally so that (1) port is marked closed before anything is
freed to avoid dangling pointers in the case of an interrupt or
error, and (2) structures are freed even in the case of a write
or close error, before the error is reported. also now mallocing
glz and lz4 structures after possibility of errors have passed where
possible and freeing them when not.
compress-io.c,
io.ss
- added return-value checks to malloc calls and to a couple of other
C-library calls.
compress-io.c
- corrected EINTR checks to look at errno rather than return codes.
compress-io.c
- added S_ prefixes to the glz* exports
externs.h, compress-io.c, new-io.c, scheme.c, fasl.c
- added entries for mutex-name and mutex-thread
threads.stex
original commit: 722ffabef4c938bc92c0fe07f789a9ba350dc6c6
(and possibly all and only even-numbered releases going forward)
and use 9.5.3 (and possibly all and only odd-numbered releases going
forward) for development.
original commit: 47110f36cea47a44078b3144c82d212de79774ce
- updated version to 9.5.2
bintar/Makefile rpm/Makefile pkg/Makefile BUILDING NOTICE
makefiles/Mf-install.in makefiles/Makefile-csug.in scheme.1.in
c/Makefile.a6nt c/Makefile.i3nt c/Makefile.ta6nt c/Makefile.ti3nt
mats/Mf-a6nt mats/Mf-i3nt mats/Mf-ta6nt mats/Mf-ti3nt workarea
c/scheme.rc s/7.ss s/cmacros.ss release_notes/release_notes.stex
csug/copyright.stex csug/csug.stex rpm/Makefile pkg/Makefile
wininstall/Makefile wininstall/a6nt.wxs wininstall/i3nt.wxs
wininstall/ta6nt.wxs wininstall/ti3nt.wxs
- fixed handling of bintar, rpm, pkg make files
newrelease
- fixed a bug in the fasl representation and reading of mutually
recursive ftypes where one of the members of the cycle is the
parent of another, which manifested in the fasl reader raising
bogus "incompatible record type" exceptions. (The bug could also
affect other record-type descriptors with cycles involving parent
rtds and "extra" fields.) object files created before this fix
are incompatible with builds with this fix, and objects files
created after this fix are incompatible builds without this fix.
fasl.ss, strip.ss,
fasl.c,
ftype.ms,
release_notes.stex
original commit: 766d591c18c2779866d1a059700e6ff1c02cb3c5