Note that even the movement of operations like `unsafe-fl+` is
constrained, since the operation can allocate. For example, a
continuation captured in
(let ([a (unsafe-fl+ x y)])
(call-with-composable-continuation ....)
a)
should return an `eq?` result. The compiler must not only refrain from
moving the `unsafe-fl+` call, it must not mark `a` as a flonum
binding, because that would cause the JIT to delay allocation of `a`
until the return site.
I'm running into stuck processes via `subprocess`, where the stuck
process is in malloc() for environment variables. I'm not really sure
of the problem, but moving that work before the fork() could
avoid problems related to pages or signal handlers.
Space used by GMP needs to be immobile, and the allocation path
on 3m still used a strategy of allocating page-sized blocks;
the GC now provides much better support for small, immobile
blocks.
The new `PLTUSERHOME` environment variable redirects all of the
user-specific paths reported by `find-system-path`.
Also, improve the tests for `raco exe` (particularly the bug
fixed in 6cb6f3fbf1) using `PLTUSERHOME`.
This change paves the way for JIT-inlining FFI operations
such as `ptr-ref`. Even without JIT treatment, the change
slightly reduces the overhead for calling FFI primitives.
When both branches of an `if` form can produce unboxed results, then
allow the unboxed result. Similarly, allow a `begin` form's last
expression to be unboxed.
This commit is a follow-up to e96d592735. The bug fixed this time is
more subtle, because the overflowing computation is never used, but
that doesn't matter in terms of avoiding undefined behavior.
Thanks for Pascal Cuoq and John Regehr.
Also, extend fixnum fast path to work more often in 64-bit mode.
More review would be appreciated to help ensure that the revised
implementation avoids undefined behavior in C.
On FreeBSD and related systems, calling localtime() on an out-of-range
value (e.g., where the year doesn't fit in 32 bits) still returns a
tm pointer, instead or returning NULL for an error. To avoid this
problem, restrict the argument to 51 bits (which seems like a lot
of bits, but is still confortably away from the overflow point).
Closes PR 14305
Incorporate a few x86_64 assembly routines from the latest GMP,
which provides a small speed boost for operations such as bignum
multiplication and division.
The warnings need to be suppressed only when compiling preprocessed
code during 3m compilation (because clang doesn't complain about
the relevant patterns when it knows that macros produced them).
Using MZ_INLINE on scheme_get_realint_val() and
scheme_get_unsigned_realint_val() leads to a link
error when using the current clang on Mac OS X 10.9.
Remove the MZ_INLINE declaration, since a modern C
compiler will inline, anyway.
When `dynamic-require` is used to access an export that isn't a
variable defined in the same module, `dynamic-require` falls
back to `eval` in a fresh namespace, which can be expensive.
The new fast path handles the case that a variable is re-exported.
The new fast path is relevant to deserialization, which now
uses a submodule that re-exports from an enclosing module.
Commit 5bae9773aa broke `chaperone-procedure` and `impersonate-procedure`
so that it didn't always produce a chaperone or impersonator. Also,
the arity-error changeds intended for that commit were not complete,
because tests were accidentally commented out.
The main repair involves a new internal property that keeps track of an
accessor that is used to extract a procedure from a field in a structure
type that has `prop:procedure`.
The main change is to add an option to `syntax-local-infer-name` to
select whether `syntax-local-name` is used, and to use the new option
to disable `syntax-local-name` for the function expression in a
keyword `#%app`.
Improvements in the expander/compiler generalize a previous repair.
Merge to v6.0
Fix various problems, including a bad result from `procedure-arity`
and problems with chaperones and arity error messages when a
structure's `prop:procedure` value is a keyword-accepting procedure.
Merge to v6.0
When a GC is needed for the shared space, a GC is triggered
in all places, and the places wait until each other place
has completed. However, the places also need to wait until
all other places are ready to *start* a GC; otherwise, a
place may be modifying a shared record while some other place
traverses it for a GC.
Closes PR 14229
Merge to v6.0
A hash-table size grew based on the number of key slots occupied,
instead of the number of value slots, where the two differ when
keys are added and removed in the table.
Thanks to Ryan for the example.
Seems to work for Mac OS X 10.9 (Mavericks), at least.
In Retina mode, a drawing unit corresponds to two pixels on
the screen or in a bitmap created by `make-screen-bitmap'.
In particular, a bitmap created by `make-screen-bitmap' is
actually twice as big in each dimension as requested, and the
bitmap is scaled when transferring to other drawing contexts.
When transferring onto the screen, scalings cancel so that the
result looks right.
Adds `get-display-backing-scale` to `racket/gui/base`, and
also `get-backing-scale` to `bitmap%`.
To do: add a way to set the backing scale of a bitmap. That
option will provide a way to give controls higher-resolution
bitmaps as labels.
Make sure it's at the end of the `raco setup` command line, and set
the executable name to "raco" instead of "raco setup" so that the `-l`
flag is effectively implied.
OpenBSD provides pthread_stackseg_np(), which directly reports
the stack-bounds information that Racket needs, so we can use
that instead of the approach used on other Unix variants. The
approach used for other Unix variants seems not to work for OpenBSD
because the stack location at the point that main() is called
is already significantly far from the stack base (on the order
of 100k on a 32-bit system in my test using OpenBSD 5.2).
A pipe's limit is supposed to apply only to unpeeked bytes, but
there were problems related to triggering further writes after
a peek, and also triggering further reads after a partial
write.
Avoids including the bit thet indicates whether the object
is GCable in the eq hash code (in a configuration where
bits are available in the GC header for hashing).
Closes PR 14059
Symbols in the PR were mapped to coliding hashes in
groups of 4 because the low 2 bits of the `eq?` hash
code were begin dropped to generate an `equal?` hash
code. Those two bits got lost due to a refectoring
a while back that moved the dropping of two useless
bits to a more centralized place, but the 2-bit shift
did not get removed from the `equal` hash code comparision.
The PR's example program will still generate groups of 2
when hashing around 10k symbols (which used to be groups of 8).
That's because there's a bit in the hash-code counter that
turns out to be forced to 1.
The problem mainly affected `register-custodian-shutdown`
from `ffi/unsafe/custodian`, which is used by `math/bigfloat`
and `ffi/unsafe/com`.
When a value is registered with a custodian, the value is held
weakly, but the shutdown procedure is intended to be held
strongly. At the C API level, the data associated with a shutdown
function pointer is intended to be held strongly.
A custodian itself, however, is retained weakly by other custodians
in its family, so that custodians can be GCed and their elements
transferred to a parent custodian. Since the custodian itself may
be held only weakly, the callback & data in a custodian was effectively
held weakly --- which, in turn, can break assumptions in code such
as `ffi/unsafe/custodian` that expects strong references to prevent
finalizers from running.
Fix the problem by registering a reference to callback data as
data in a custodian's finalizer, which makes the data strongly
retained no matter how the custodian is retained.
Bug found initially by Juan Francisco Cantero Hurtado. Reported by many.
Mark Kettenis (from the OpenBSD Project) found the real reason of the
crash and created this patch for libffi. Patch taken from OpenBSD Ports.
The `--checksum` argument's main use is that it lets you pick a specific
commit from a GitHub repository. More generally, it lets you simulate
a package-catalog result, which includes a checksum.
Also, adjust checking of downloaded checksums to ensure that they
match the expected checksum, as predicted by a package catalog or
by the `--checksum` argument.
Also, move remaining "srfi" libraries to "srfi-lite-lib".
In principle, "base" should depend on "scheme-lib" and
"srfi-lite-lib", and a new "base2" package would represent the new,
smaller base. But I don't think the window has yet closed on
determining the initial "base" package.
The "srfi" libraries moved to "srfi-lite-lib", instead of "srfi-lib",
to avoid creating many extra dependencies on "srfi-lib" and all of its
dependencies. The SRFIs in "srfi-lite-lib" depend only on "base",
and they are used relatively widely.
Having `__VFP_FP__` defined does not mean that VFP instructions are
available; it just means that floating-point is native-endian.
According to
https://wiki.debian.org/ArmEabiPort
the absence of `__SOFTFP__` combined with the precense of `__VFP_FP__`
can mean VFP, though.
The computations already existed in the built-in code, so moving
the functions reduces code duplication. Caching the values will
save a little time, but mostly it will avoid sandbox interactions
with the task of locating the main "collects" and "etc" directories.
This variable is intended to support machine-code tracing
experiments. To enable a dump of ranges on exit, both
define PLT_DUMP_JIT_RANGES at compile time and as an environment
variable at run time.
Document and adjust `hash-clear!', `hash-clear', and `hash-empty?'.
Also, add `hash-copy-clear'.
The clear operations are constant-time for a non-impersonated
hash table, otherwise they always remove keys one-by-one to
trigger the impersonator's interpositions.
The `hash-clear' operation works only on immutable hash tables,
in contrast to the original implementation. The new `hash-copy-clear'
works on both immutable and mutable hash tables. The "copy"
in its name is meant to suggest a difference with `hash-clear',
even on immutable hash tables: any chaperone on the input
is not on the outpue.
Change `set-clear' to be like `hash-clear', and add
`set-copy-clear'.
(Changes are in consultation with Carl.)
When an existing entry in the AVL tree for an immutable hash
is replaced with a new one, the new one did not always get
the right depth, which could throw off the tree balance.
Make the stack-safety margin twice as big for 64-bit platforms
as 32-bit platforms. That was already done for Windows, but it's
also needed for Mac OS X. Also, double-check that there's a
good amount of space on the stack before calling a foreign
function.
There was an off-by-one error in trimming overflow
records in a captured continuation.
I provoked the crash by running the program below on Mac OS X;
resizing the frame caused a crash. It has something to do with the
`try-atomic' implementation, I think. I wasn't able to make a test
case in a half-hour of trying, however, and I'm giving up for now.
(define f (new frame% [label "deep"]))
(define b (new button%
[parent f]
[label "0"]))
(send f show #t)
(let loop ([n 0] [m 0])
(if (= n 10000)
(begin
(send b set-label (format "~a" m))
(for ([i 10]) (yield))
(loop 0 (add1 m)))
(cons 1 (loop (add1 n) m))))
These comparisons are useful for sorting while avoiding the overhead
of conversions to bytes or strings.
Having `path<' reduces the cost of sorting in `directory-list'.
A launcher can have a ".desktop" file (found like other files: as the
same name as the main launcher file, but with a ".desktop" suffix),
where the "Exec" and "Icon" fields are added automatically. A ".png"
or ".ico" file can be supplied for the icon (where the ".ico" file
is already used for Windows launchers).
Closes PR 13953
Fix various problems with Unix-style install from an installer.
Also, add an ugly icon for the Racket Package Manager, with the hope
that it will provoke someone to create a nicer one.
The issue is that gcc and the Sun linker do not cooperate
correctly to implement thread-local variables on x86_64.
Since gcc is normally configured to use the Sun linker by
default, enabling places and futures is asking for trouble.
Fix SIGCHLD suspension for fork()-based file locks (i.e., Solaris).
Also, fix commit ea51d32e, which broke termination of process groups
where the main process terminated before the rest of the group,
because it used sigwait() before the terminate action.
Make the GC always use the mmap() block cache, since mmap() on Solaris
allocates much more than a page when a single page is requested.
Enable places and threads by default on x86 and x86_64.
Fix pthread-related compilation flags.
The range of values used to represent "improper lists"
of length 36 to 65 overlapped with the range of values
used to represent other things.
This bug is the new chapion of the "how did we not hit that
earlier?" category. The bug was introduced around v300, at
the latest.
The intent of disallowing `handle-evt?' arguments to `wrap-evt',
`handle-evt', and `chaperone-evt' was that those extra wrappers
break the tail-handling behavior that is almost certainly intended
when `handle-evt' is used. The extra checking was not obviously
worthwhile (we don't have any checked "this procedure should be called
in tail position" annotations, after all), and pushing the distinction
through Typed Racket looked particularly inconvenient.
Dropping the constraint is trivial if we say that wrapping a
`handle-evt' result disables the tail invocation of the handler
procedure.
Although not documented as such, the implementation used to return
form did not take the special meaning of #f into account. It seems
better to fix `syntax-local-lift-context' to match its documentation.
The `--enable-portable-binary' flag disables optimizations specific
to the build machine's processor that may ne unportable to other
machines.
This also fixes a problem where a VirtualBox runs on an x86_64 machine
with AVX support, and so `congure' enables AVX operations, but AVX
doesn't work within a virtual machine.
An installation has a name (via the configuration file "config.rktd")
that defaults to the version string. The name, instead of the
Racket version, is used for forming the path to the user "collects"
directory, user packages, and so on. The `user' package scope is
thus user- and installation-name-specific (instead of user- and
version-specific).
Remove `shared' package and link scope, since the notion of
installation names generalizes the concept (a set of installations
can be given the same name) and fits it into `user' scope.
The "share" directory holds platform-independent files, while
"lib" holds platform-specific files.
In principle, the "collects" directory belongs in "share",
as does "doc". Those directories are put into "share"
by a Unix-style install, but left at top level for an
in-place install.
Packages in installation scope are put in "share" instead
of "lib", and the top-level Makefile puts development links
in "share/devel-pkgs".
The `configure' script now supports `--docdir' and `--collectsdir'.
Changed the version to 5.90.0.1.
Specifically, this change disables the use of inotify() for detecting
changes to collection-links files, because the latency is too large
on some (many?) Linux configurations. (The fallback is to detect changes
to a links file by reading the whole content every time.)
Create a single inotify() connection per place, which should reduce
the latency of operations on filesystem change events and make
them generally scale better on Linux.
Internally, add a filesystem-never-changes mode, which could be useful
for platforms with fixed filesystems, but it's also for experiments in
checking the cost of filesystem change events.
Some non-transparent but serializable data structures broke
the comparison between previous and new outputs, which caused
too many document rebuilds.
Includes a change to make module path indexes work with `equal?'.
The implement of `free-id-table' uses `identifier-binding'
to decide on a symbolic name as a key for each identifier,
but `identifier-binding' doesn't provide enough information
for local and top-level bindings. The new `identifier-binding-symbol'
function provides that information.
Closes PR 13911
More generally, `LINK_MODE' controls how the `PKGS' value is saved
or restored: "--save" saves the value (the default), "--restore"
uses a previously saved value (if any), and "" disables saving or
restoring.
The `again' target recurs to `in-place' with `LINK_MODE=--restore'.
A path that is not relative to the enclosing file can show up
due to cross-module inlining. Package-based modules do not have
a good relative path to "collects", which creates trouble for
distributing compiled modules where, say, `map' was inlined.
It might be possible to keep the path in module-path-index form
so that a path can be constructed appropriately at run time, but
it's much simpler to just punt on function source locations in
this relatively rare case.
The main result is that `path->selative-string/library' now generates
"<pkg>/..." strings.
To make that possible, minimal support for reading the
installed-package database moved to a new `pkg/path' library.
To make that possible and avoid poetntial problems from concurrent
reading and writing of the database file, `racket/file' now provides
`call-with-atomic-output-file', which implements the write-and-move
dance that CM uses for compiled bytcode (i.e., `with-compile-output').
The new function is used to write links and installed-package files.
Finally, `racket/base' provides the new function
`call-with-default-reading-parameterization', which is used to guard
various file `read's to make them consistent and avoid security holes.
Use `filesystem-change-evt' (where supported) to detect changes to
collection link files.
Add "static root" as a new kind of collection root directory in links
files. A static root directory is assumed to not change (in terms of
its collection subdirectories) as long as the links file itself does
not change.
Propagate the notion of static roots through `raco link' and `raco pkg
install'.
Change the `pkg-links' makefile target to install static links
instead of plain links.
The result of all of these changes is to cut 25%-33% of the
time for `racket -l racket', bringing it back in line with
the pre-package-reorganization time.
The `filesystem-change-evt' function takes a path to a file
or directory and returns an event that becomes ready when
the file or directory changes (conservatively, so false
positives are possible).
These events are supported on Linux, Mac OS X and other BSD
variants with kqueue(), and Windows.
This is a variant of the bug fixed in
49fbca5b18,
where a GC-notification callback still
could cause problems in a GC during a finalization
callback.
(Bug found by running tests in GC-stress mode.)
A foreign procedure's data could get GCed before the procedure
was called, if the procedure is not otherwise reachable.
(Bug found by running tests in GC-stress mode.)
GC during allocation of a pair, weak box, ephemeron, or
weak array went wrong if the GC-notification callback
allocated any of those kinds of things.
(Bug found by running tests in GC-stress mode.)
Remaining are:
- parts of unit200 that Matthew plans to remove.
- the `mzscheme` implementation itself.
The implementation of `mzscheme` has been moved
to the `mzscheme` collection (from the `racket` and
`scheme` collections). The `scheme/mzscheme`
language, which was undocumented, has been removed.
This is slightly backwards-incompatible, because
the `xform` handling of precompiled headers now
evaluates code in a `racket/base`-like namespace,
instead of in a `mzscheme`-like namespace.
The new `--no-pkg-deps' or `-K' flag skips the check.
If a module in package X refers to a module in package Y, check that
package X declares a dependency on Y. Note that package X must
specifically depend on Y --- not another package that at the moment
happens to declare a dependency on Y.
A new "base" package represents the content of the core (so that, if
the core shrinks, a new "base2" can represent the smaller core).
Most every package now needs a dependency on "base".
Sometimes, it makes sense for X to access Y when X declares a
dependency on Z, because Z promises to always depend on Y. For
example, the "gui" package is defined to combne "gui-lib" and
"gui-doc", so it's appropriate to use the modules of "gui-lib" when
depending on "gui". A package's "info.rkt" can therefore define
`implies' as a subset of the dependencies listed in `deps', which
means that depending on the package implies a dependency on the listed
packages. (It's even possible for packages to mutually imply each
other, which is why the dependency checking code ends up with a
union-find.)
Dependency checking distinguishes between run-time dependencies and
build-time dependencies: anything listed in a ".dep" file is a build
dependency, at least. To imply a run-time dependency, a reference must
appear in a bytecode file's imports, and not in a subdirectory or
submodule that would be pruned for a binary package.
The `--fix-pkg-deps' flag attempts to automatically fix package
dependency declarations (i.e., modify a package's "info.rkt" file)
based on inferred dependencies.
Use `PKGS' with the top-level makefile to select packages for
a development-mode build. The default is "main-distribution",
which includes all packages in "pkgs".
Making them "etc"-relative intercts badly with redirecting
a configuration to override just a few values --- such as
the links path, which is what `make core' needs.
* Clarified bogosity of toplevel .gitignore (and other such files)
* Removed "doc/" in the toplevel file -- looks like this was some broken
leftover, and it's dangerous for at least "scribble/doc" (which
contains code).
* Collapse more common patterns into worksp instead of in each file.
* Use a trailing "/" for directories.
* racket/lib/collects/pkg/.gitignore looks like a leftover that is no
longer needed.
Allow the location of the installation-specific "links.rktd" file to
be specified in "config.rktd", and also allow extra link files to
be provided.
Allow the same for package directories.
The main file/directory in each case corresponds to the file/directory
that can be modified by an installation-scope install. Extra files
or directories in a search path supports constant links and libraries
that are shared across installations --- like "/usr/lib" versus "/lib".
The 1-second granularity of filesystem timestamps is not
good enough to deetct changes to the file --- especially
when `raco pkg' installs links and runs `raco setup' (in
the same Rcket process), in which case a newly installed link
might not be detected.
The longer-term repair is probably to add file-changed
events to Racket (based on `inotify' and similar interfaces
provided by OSes).
A collection declares release notes with a `release-notes' field in
"info.rkt".
The "doc" directory is now populated exclusively by generated content,
instead of having a static "release-notes" directory (and a "keep-dirs.rktd"
file to record the static directories).
The "racket" directory contains a pared-back version of the
repository, roughly.
The "pkgs" directory everything else in the repository, but
organized into packages.