Internal; used by some of the C backend tests to check that the number of
allocations matches the number of frees.

.. internal
