Commit Graph

40268 Commits

Author SHA1 Message Date
Matthew Flatt
d02fbebba8 schemify: improve handling for mutated, known-initialized variables
Avoid unnecessary checks for an "undefined" state.
2019-09-19 07:29:16 -06:00
Paulo Matos
f0a0ffc50d
Add support for MSVC2019 (#2827) 2019-09-19 15:27:12 +02:00
Matthew Flatt
2b567b4488 cs & thread: avoid counting a descheduled thread as "no progress"
It's not clear that a thread can be descheduled without the current
thread's work counting as progress, but a descheduled thread certainly
shouldn't coun as a no-progress scheduled thread.
2019-09-18 14:03:20 -06:00
Matthew Flatt
19efcb955d cs & io: avoid spinning if epoll/kqueue setup fails 2019-09-18 14:03:20 -06:00
Matthew Flatt
ec72f5df45 cs & thread: avoid accumulating post-atomic callbacks
Only one instance of each callback is needed. Allowing them to pile up
is inefficient, and possibly it can trigger a reaction that causes
even more to pile up.
2019-09-18 14:03:20 -06:00
Ryan Culpepper
b86ca89102 fix error message 2019-09-18 11:29:54 +02:00
Ryan Culpepper
375a4837c7 format-id: add #:subs? option for sub-range-binders
inspired by #2624 by @lexi-lambda
2019-09-18 11:29:54 +02:00
Gustavo Massaccesi
3907f35d1d fix error of malformed in-values in a for clause
(for ([x (in-value 1 2)]) x)

should raises a run time error, not a syntax error.

Fix similar error in other in-something macros.

Fix name of in-directory, when used as a function outside a for.
2019-09-17 11:52:41 -03:00
Paulo Matos
3a512a2a60
Enable MZ_NORETURN annotation only if MZ_PRECISE_RETURN_SPEC is defined (#2823)
Unfortunately, MZ_NORETURN spec is causing a few problems - see #2808
It would be great to fix these but due to lack of time, this is a
workaround that should keep things working until all supported
configurations accept MZ_NORETURN properly.
2019-09-17 08:36:04 +02:00
Robby Findler
f61efeaf80 edit ->i docs along the lines of the discussion in #2822 2019-09-15 17:50:33 -05:00
Ben Greenman
17c424b553
typo: 'specifcation' -> 'specification' 2019-09-14 17:22:08 -04:00
Matthew Flatt
4e07c20afe cs: improve Chez Scheme version check
Use the new `scheme-fork-version-number` function to make sure
the build uses the latest.
2019-09-13 07:32:07 -06:00
Ben Greenman
a5448f112d for/stream: delay finding first element
Fixes #2812
2019-09-12 14:18:16 -05:00
Matthew Flatt
72852c7b75 cs: use call-consuming-continuation-attachment
Use `call-consuming-continuation-attachment` to implement
`with-continuation-marks`, because that avoids duplicating
a set of checks when in tail position.
2019-09-11 17:21:25 -06:00
Matthew Flatt
5bcf7eb19d cs: fix optiimizer arity for make-parameter
Should have been part of 91d702c6fe.
2019-09-08 17:58:34 -06:00
Matthew Flatt
2403b18e0f cs: more constant tokens
Should have been part of 12a2cd75a8.
2019-09-08 17:57:10 -06:00
Alexis King
415f030212 Fix syntax-local-value[/immediate] rename transformer context
fixes #2815
2019-09-08 14:56:43 -05:00
Matthew Flatt
866c5d41e0 cs: unbreak Windows build 2019-09-08 07:24:49 -06:00
Matthew Flatt
f4fa74e6f2 expander: fix reader bug
Fix incorrect comparison of character to EOF. There's a test, already,
but the test fails only if the expander is compiled in safe mode.
2019-09-06 17:35:54 -06:00
Matthew Flatt
4c630a2442 sync bootstrapped expander
Update expander embedded in traditional Racket to pick up
the parameter names added in 5147771b04.
2019-09-06 17:35:54 -06:00
Matthew Flatt
3024b77ba5 add custodian-based unloading of foreign libraries
Specificially, add a `#:custodian` argument to `ffi-lib`.
2019-09-06 17:35:54 -06:00
Matthew Flatt
276a102d6a add ffi-lib-unload at the #%foreign level 2019-09-06 17:35:54 -06:00
Sam Tobin-Hochstadt
5147771b04 Name more internally-defined parameters and std library parameters. 2019-09-06 11:54:22 -04:00
Paulo Matos
a5abfa9a0d
Fix typo 2019-09-06 08:35:28 +02:00
Matthew Flatt
8bb41e590d cs: yet another try at the major-GC heuristic
Looking at `bytes-allocated` usually works, but sometimes lets
memory use spiral out of control. Looking at `current-memory-bytes`
is more reliable, but still makes peak memoy use too high.
Combining those values doesn't limit the peak well enough.
Try the more obvious (in retrospect) approach of comparing
`bytes-allocated` changes and `current-memory-bytes` changes
separately, and triggering a GC if either grows enough.
2019-09-05 20:14:31 -06:00
Matthew Flatt
12a2cd75a8 cs: constant tokens
Instead of allocating tokens like `undefined` or `parameter-key`
with `gensym` on startup, allocate them once for all eternity.
2019-09-05 11:13:41 -06:00
Matthew Flatt
8284dfa1b1 cs: add names for primitive parameters 2019-09-05 08:22:49 -06:00
Matthew Flatt
1f2342b57a cs: adjust trigger major GC
Commit 1811193285 caused Racket CS to have much higher peak memory
use. Adjust the heuristic again to trigger a major GC when the
`current-memory-bytes` value is the post-GC `bytes-allocated` plus the
post-GC `current-memory-bytes`, which means waiting until
another `bytes-allocated` bytes are allocated (instead of waiting
until the number of newly allocated bytes also catches up to overhead,
such as unserused pages due to locked objects).
2019-09-05 08:22:49 -06:00
Matthew Flatt
91d702c6fe add name argument to make-parameter 2019-09-05 08:22:49 -06:00
Matthew Flatt
cccaf4e46e cs: change representation of parameters
Implement a parameter as a Chez Scheme wrapper procedure,
instead of an applicable record. A wrapper procedure can be
applied more directly, saving 10-20% of the time for some
parameter lookups.
2019-09-05 08:22:49 -06:00
Paulo Matos
8c049d914e
Remove definitions for __LITTLE_ENDIAN, __BIG_ENDIAN, and __BYTE_ORDER (#2807)
These are already defined in /usr/include/endian.h for all tested configurations
Related to #2797
2019-09-04 19:32:02 +02:00
Matthew Flatt
36e00806de io: fix call to raise-arguments-error 2019-09-03 18:47:44 -06:00
Matthew Flatt
88464b327a ffi doc: make-wrap-<id> binding from define-cstruct
When `#:property` is used wih `(define-cstruct _<id> ....)`, then
`make-wrap-<id>` is among the defined identifiers.
2019-09-03 18:47:44 -06:00
Jon Zeppieri
b0d753e2d6 Implements negated unicode categories in pregexps
The grammar for pregexps includes:

   | \p{‹property›} Match (UTF-8 encoded) in ‹property›
   | \P{‹property›} Match (UTF-8 encoded) not in ‹property›

and <property> is defined as:

   ‹property› ::= ‹category› Includes all characters in ‹category›
               |  ^‹category› Includes all characters not in ‹category›

That is to say, there are two independent ways to negate one of
these character classes. The Racket implementation of regexps
(as opposed to the C implementation) does not recognize negated
categories. This PR fixes that.
2019-09-03 18:47:33 -06:00
Matthew Flatt
9fa6e9e25d repair GC problem with 'atomic-interior / 'interior
Some parts of the GC meant to traverse all objects on a page of
'atomic-interior or 'interior objects used "<" to detect the end of
the page, but "<=" was needed. As a result, things could sometimes go
wrong for the last object on a page for platform and size combinations
where the last object ends exactly at the end of the page.

This change consistenly computes the iteration end in a way that makes
both "<" and "<=" work.

Using MPFR bindings from the `math` library could trigger a problem
(but it's difficult to provoke the problem in a reasonably small
example --- difficult enough that I couldn't do it).
2019-08-30 12:25:32 -06:00
John Clements
65ce0cd468
gen:stream fix example code (#2802) 2019-08-30 10:34:09 -04:00
Matthew Flatt
1811193285 cs: correct and imprrove heuristics for force a major GC
Use `current-memory-bytes` instead of `bytes-allocated` to determine
major GCs, because the latter doesn't include enough (perhaps missing
finalized values). For example, the repair avoids unbounded memory use
from

  (let loop ([i 0])
    (malloc 6400 'atomic-interior)
    (loop))

due to finalizers that pile up faster than they are run.
2019-08-30 06:32:17 -06:00
Matthew Flatt
dd5e517e88 cs: fix random-seed to be compatible with Racket
Fix `random-seed` to set the pseudo-random generator's
state to the same state as traditional Racket.
2019-08-29 19:14:39 -06:00
Matthew Flatt
afef3fe900 remove unused C function declaration 2019-08-28 15:51:51 -06:00
Matthew Flatt
fd63d5a1ba cs: rewrite error message for car, cadr, etc.
Closes #2798
2019-08-28 05:56:47 -06:00
Matthew Flatt
1e2019f600 reference: add pointers to immutable?
When reading just the vector section of the Reference, it's
not obvious that `immutable?` distinguishes immutable vectors,
so add a note there. And the same for sttrings, etc. The section
on boxes was missing the usual paragraph on mutability.

Based on a suggestion from Shriram.
2019-08-27 15:57:31 -06:00
Gustavo Massaccesi
800ea98525 use KMP to avoid quadratic time in string-contains? 2019-08-27 09:59:51 -03:00
Matthew Flatt
a8d5a4f2f4 avoid unneed preprocessor redefinition
Limit a Mac-specific declaration that isn't needed anyway.

Related to #2797
2019-08-27 06:01:16 -06:00
Sam Tobin-Hochstadt
81bdbb19e9 Add guide documentation on printing exception information.
Suggested by badkins.
2019-08-26 09:33:09 -04:00
Matthew Flatt
76a7ee0ccd raco exe: expand in fresh namespace
Related to racket/typed-racket#852
2019-08-26 05:32:28 -06:00
Matthew Flatt
9f424cfe0a cs: fix procedure names in jitified linlet to use 'inferred-name
When a linklet is too large to pass to Chez Scheme whole, then
names for the procedures that are individually compiled need to
be extracted from 'inferred-name for reference in the wrapper.

Closes #2787
2019-08-22 21:06:53 -06:00
Matthew Flatt
2a5df8ad2a rktio: fix Windows network error reporting
Convert wide-character error message to UTF-8.

Closes #2794
2019-08-22 17:15:20 -06:00
Matthew Flatt
d14a4f75a1 read: refine message for some ill-formed #lang lines
In particular, improve the message when `#lang` is followed
by two space characters.
2019-08-22 15:40:59 -06:00
Nick Thompson
8d2b0ba363 Add native dark mode to macOS apps
Enables native dark mode UI elements in macOS 10.14 and above. Adds the
'NSRequiresAquaSystemAppearance' key with a value of 'false' to the
Info.plist file, while allows UI elements to match the system theme even
when not building against the latest SDK.
2019-08-22 14:37:33 -06:00
Matthew Flatt
e8cb4015a7 adjust tests to accomodate no-pthread build modes
The new fifo handling requires pthreads, so skip some tests where
the implementation falls back to a less complete implementation.
2019-08-22 09:08:20 -06:00