This is a workaround for #1815. libev uses realloc(0) to
free the loop, which valgrind doesn't like. We have suppressions
to make valgrind ignore them.
Valgrind also has a sanity check when collecting allocation backtraces
that the stack pointer must be at least 512 bytes into the stack (at
least 512 bytes of frames must have come before). When this is not
the case it doesn't collect the backtrace.
Unfortunately, with our spaghetti stacks that valgrind check triggers
sometimes and we don't get the backtrace for the realloc(0), it
fails to be suppressed, and it gets reported as 0 bytes lost
from a malloc with no backtrace.
This fixes the issue by alloca'ing 512 bytes before calling uv_loop_delete
Adds back the ability to make assertions about locks, but only under the
--enable-debug configuration
This reverts commit b247de6458.
Conflicts:
src/rt/rust_sched_loop.cpp
This was happening when running the rustdoc tests. The test proceeded
fine after that, and the code looks like it is running before anything
we generate, so I assume it is spurious.