HeapCheck: Low-cost Hardware Support for Memory Safety