Memory allocation with added stress tests and integrity checks
Provide adaptions of
mallocForeignPtrArray and
allocaArray that add stress tests and integrity checks.
There are three modules:
- Guarded.Plain: exports the original allocation
routines
- Guarded.Debug: exports allocation routines that add
stress and checks
- Guarded: exports either Guarded.Plain or
Guarded.Debug depending on the Cabal debug
flag.
It is intended that you always import the
Guarded module in
user code and install a package version with enabled debug flag to a
custom package database for debugging. If you compile your user
program you can choose production or debugging mode by choosing the
default or the custom debugging package database, respectively.
This package is inspired by the famous Amiga debug tool MungWall. The
Linux counterpart is Electric Fence.