Runtime and toolchain for whole-program monitoring of allocations and their data types