Skip to content
Snippets Groups Projects
Forked from Glasgow Haskell Compiler / GHC
93 commits behind the upstream repository.
Teo Camarasu's avatar
Teo Camarasu authored
Allocation Limits allow killing a thread if they allocate more than a
user-specified limit.
We extend this feature to allow more versatile behaviour.

- We allow not killing the thread if the limit is exceeded.
- We allow setting a custom handler to be called when the limit is exceeded.

User-specified allocation limit handlers run in a fresh thread and are passed
the ThreadId of the thread that exceeded its limit.

We introduce utility functions for getting and setting the allocation
limits of other threads, so that users can reset the limit of a thread
from a handler. Both of these are somewhat coarse-grained as we are
unaware of the allocations in the current nursery chunk.

We provide several examples of usages in testsuite/tests/rts/T22859.hs

Resolves #22859
ea2c6673
History
Code owners
Assign users and groups as approvers for specific file changes. Learn more.

GHC Testsuite Readme

For the full testsuite documentation, please see here.

Quick Guide

Commands to run testsuite:

  • Full testsuite: hadrian/build test
  • Using more threads: hadrian/build test -j12
  • Reduced (fast) testsuite: hadrian/build test --test-speed=fast
  • Run a specific test: hadrian/build test --only="tc055 tc054"
  • Test a specific 'way': hadrian/build test --test-way=optllvm
  • Skip performance tests: hadrian/build test --skip-perf
  • Set verbosity: hadrian/build test --test-verbose=<n> where n=0: No per-test output, n=1: Only failures, n=2: Progress output, n=3: Include commands called (default), n=4: Include perf test results unconditionally, n=5: Echo commands in subsidiary make invocations

Testsuite Ways

The testsuite can be run in a variety of 'ways'. This concept refers to different ways that GHC can compile the code. For example, using the native code generator (-fasm) is one way, while using the LLVM code generator (-fllvm) is another way.

The various ways that GHC supports are defined in config/ghc

Adding Tests

Please see the more extensive documentation here.