errorchecked_heap example