aboutsummaryrefslogtreecommitdiff
path: root/src/InternPool.zig
diff options
context:
space:
mode:
authorFrank Denis <github@pureftpd.org>2023-10-02 19:37:17 -0600
committerAndrew Kelley <andrew@ziglang.org>2023-10-03 02:51:01 -0700
commit4930094e622c043d9be459abbfc5a7b203a22aa2 (patch)
tree19e81fd0a9271a3f5d97ccb47740d8564ac898ff /src/InternPool.zig
parent0bdbd3e235daee64caf1f99e5b9d7b62f4c5c484 (diff)
downloadzig-4930094e622c043d9be459abbfc5a7b203a22aa2.tar.gz
zig-4930094e622c043d9be459abbfc5a7b203a22aa2.zip
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.
Diffstat (limited to 'src/InternPool.zig')
0 files changed, 0 insertions, 0 deletions