zig/lib/std/valgrind
Frank Denis 4930094e62 valgrind.memcheck: fix makeMem*()
The `makeMem*()` functions crashed under valgrind in Debug and
ReleaseSafe modes.

The reason being that `doMemCheckClientRequestExpr()` returns `0`
when not running under Valgrind, and `maxInt(usize)` when running
under Valgrind.

Thus, `@as(i1, @intCast(maxInt(usize)))` always fails and these
functions crashed before returning.

That being said, what these functions used to return was quite
unexpected: `0` on error and `-1` on success (=running under valgrind).
That doesn't match any Zig nor C conventions.

But that return value doesn't seem to be very useful. Either we are
running under Valgrind or we are not. There's no point in checking this
for every single call. Applications are likely to always discard it.

So, just return a `void` instead.

Also avoid function comments that start with `Similarly, ...` because
that doesn't refer to anything in the context of autodoc or in IDEs.
2023-10-03 02:51:01 -07:00
..
callgrind.zig all: migrate code to new cast builtin syntax 2023-06-24 16:56:39 -07:00
memcheck.zig valgrind.memcheck: fix makeMem*() 2023-10-03 02:51:01 -07:00