Report a bug
If you spot a problem with this page, click here to create a Bugzilla issue.
Improve this page
Quickly fork, edit online, and submit a pull request for this page. Requires a signed-in GitHub account. This works well for small changes. If you'd like to make larger changes you may want to consider using a local clone.

etc.valgrind.valgrind

D wrapper for the Valgrind client API. Note that you must include this file into your program's compilation and compile with -debug=VALGRIND to access the declarations below.
nothrow @nogc void makeMemNoAccess(const(void)[] mem);
Mark the memory covered by mem as unaddressable.
nothrow @nogc void makeMemUndefined(const(void)[] mem);
Similarly, mark memory covered by mem as addressable but undefined.
nothrow @nogc void makeMemDefined(const(void)[] mem);
Similarly, mark memory covered by mem as addressable and defined.
nothrow @nogc uint getVBits(const(void)[] mem, ubyte[] bits);
Get the validity data for the address range covered by mem and copy it into the provided bits array.
Returns:
  • 0 if not running on valgrind
  • 1 success
  • 2 [previously indicated unaligned arrays; these are now allowed]
  • 3 if any parts of mem/bits are not addressable.
The metadata is not copied in cases 0, 2 or 3 so it should be impossible to segfault your system by using this call.
nothrow @nogc uint setVBits(const(void)[] mem, ubyte[] bits);
Set the validity data for the address range covered by mem, copying it from the provided bits array.
Returns:
  • 0 if not running on valgrind
  • 1 success
  • 2 [previously indicated unaligned arrays; these are now allowed]
  • 3 if any parts of mem/bits are not addressable.
The metadata is not copied in cases 0, 2 or 3 so it should be impossible to segfault your system by using this call.
nothrow @nogc void disableAddrReportingInRange(const(void)[] mem);

nothrow @nogc void enableAddrReportingInRange(const(void)[] mem);
Disable and re-enable reporting of addressing errors in the address range covered by mem.