mirror of
https://github.com/ziglang/zig.git
synced 2024-11-28 08:02:32 +00:00
4930094e62
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. |
||
---|---|---|
.. | ||
callgrind.zig | ||
memcheck.zig |