Swap order of argument for `environment-variables-get'
and `environment-variables-set!', so that the environment
variables come first --- which follows the usual order.
This change means that the parameter isn't used to get
the default environment variables, but that seems ok; the
convenient interface is `getenv' and `putenv'.
On Windows, case-normalized environment variable names.
Also, change the implementation to use an immutable hash
internally.
Fix ephemeral-port support in `udp-bind!', and
change `udp-bind!' and `udp-connect!' to try address
resolutions in order to find one that works (which is
typically needed to auto-select an IPv4 or IPv6 variant
of an address).
The `current-environment-variables' parameter determines the current
mutable "environment variable set". If that set is the initial one for
a Racket process, then using the set corresponds to working with OS
environment variables. Otherwise, it's really just a hash table that
is packaged up as OS environment variables if a subprocess is created.
The new environment-variable interface works in terms of bytes, instead
of assuming that environment variable names and values fit in a string
encoding.
The string-based `getenv' and `putenv' are still available as
convenience wrappers. The checking on environment-variable names
for those wrappers is a little tighter, preventing any attempt to use a
name that contains "=".
On OpenBSD, for example, the libffi link test doesn't work until
"-pthread" is in $LIBS.
Also, make `configure' complain if `--enable-libffi' is specified
and linking to libffi fails.
Allow a thread to be GCed when it is blocked on a place
channel for reading and the place channel's write end
is inaccessible.
GC is limited to threads that do not participate in cycles
of such threads, where the otherwise unerachable threads
are blocked on place channels that are reachable among the
set of threads. In other words, the GC finds the greatest
fix point (as measured by the threads to retain) instead of
least fix point --- which isn't what you want, but finding
the least fix point seems to require significant extra GC
machinery across places.
This improvement was intended to solve the same problem as
commit 7b0608c, but that case seems to run into the limitation
on cycles.
A tail call with certain kinds of primitives would fail to
clear local bindings in a detectable way. For example, a
tail call to `sync' that blocks could retain references
to unreachable data in the context of the `sync' call.
Primitives that can cause problems in the run-time system
are already identified as "imemdiate" primitives. The
safe-for-space pass now inserts clearing actions before a tail
call, unless the call it to a known immediate primitive or a
Racket-implemented function.
Clearing operations are now omitted before non-tail calls
to immediate operations like structure predicates.
The newly added clearing operations could affect performance,
but they probably won't, since the clear operations are still
avoided in tail-call cases that are otherwise fast. The newly
omitted clearing operations may improve performance.
The shortcut could be triggered in a bad case (first
argument as `#f' in non-timeout mode) and returned the
wrong result (void instead of the semaphore).
Enable extflonums in a MSVC build by relying on a MinGW-built DLL,
"longdouble.dll". The DLL is loaded on startup. If the DLL isn't
available, then `extflonum-available?' reports #f.
Instead of setting the floating-point mode globally to extended
precision, the mode is changed only just before (and restored right
after) extflonum arithmetic operations.
Using an impersonator property to represent an application mark was
a bad choice. The property gets propagated, so it is also on any later
chaperone layer, and then things go bad: the docs say that special
treatment is triggered by supplying an argument to `impersonate-property',
but it was actually triggered by the chaperone having the property.
Change the implementation to match the documentation. Using an
impersonator property to supply the mark should be regarded as a hack,
but now the implementaiton is at least consistent with the documentaiton.
"-rdynamic" doesn't work with GCC 4.7 on OpenBSD: "cc: error:
unrecognized command line option '-rdynamic'". The switch isn't
necessary because it is only a wrapper to "-Wl,--export-dynamic".
Look GCC bug 37454.
For immutable hashes, `hash-iterate-{key,value}' used to take O(N) time on
the first call for a particular table and O(1) thereafter. Now it takes
O(1) time for all calls, the constant is only slightly larger for
the non-first calls, and there's no extra allocation.
The intent is to support phase-crossing data such as the `exn:fail:syntax'
structure type that is instantiaed by macros and recognized by contexts
that use `eval' or `expand'. Phaseless modules are highly constrained,
however, to avoid new cross-phase channels, and a module is inferred to
be phaseless when it fits syntactic constraints.
I've adjusted `racket/kernel' and improved its documentation a little
so that it can be used to implement a phaseless module (which can
import only from other phaseless modules).
This change also adds a `flags' field to the `mod' structure type
from `compiler/zo-structs'.
The bug was introduced when changing the order of unboxed argument
staging along with extflonum unboxing support. The main symptom of
the bug was that icons were sometimes blacked out in DrRacket.
The check was incomplete in the case that both arguments to a binary
[ext]flonum function need to be checked and the second one was not an
[ext]flonum and also not a fixnum.
The problem was exposed by improved error checking
in the expander to detect references to exports of a module that
is not yet visited, and as triggered by the documentation for
`2htdp/planetcute'.
Includes a repair for floating-point `min' and `max' that affects all
x86 builds that use SSE arithmetic, leaving the (otherwise unused)
floating-point stack in a bad state, which might have affected
x87-using C/foreign libraries running alongside Racket.
wrap/handle-evt that receives multiple values must have a handler function with adequate arity.
struct.c:
change contract for wrap/handle-evt from (any/c -> any) to procedure?
thread.c:
adjust sync processing
sync.rktl:
add test for handle-evt, wrap-evt and prop:evt
Repair 73e07f576b added an item to a list without incrementing a
counter for the list length, which cause a different element of
the list to be dropped, which could mess up binding resolution in
arbitrarily bad ways.
(Ths bug falls into the "how did this not get exposed earlier?" bin,
although part of the answer is that it requires a combination of
module re-expansion and simplification of syntax objects in the
residual program.)
Closes PR 13428
An extflonum is like a flonum, but with 80-bit precision and
not a number in the sense of `number?': only operations such as
`extfl+' work on extflonums, and only on platforms where extflonums
can be implemented by hardware without interefering with flonums
(i.e., on platforms where SSE instructions are used for
double-precision floats).
[Patch provided by Michael Filonenko and revised by Matthew.]
The compiler tracks information about bindings that are known to
hold extflonums, but the JIT does not yet exploit this information
to unbox them (except as intermediate results).