) -> EvalResult<'tcx> {
Ok(())
}
+
+ /// Hook for performing extra checks on a memory deallocation.
+ /// `size` will be the size of the allocation.
+ #[inline]
+ fn memory_deallocated(
+ _alloc: &mut Allocation<Tag, Self>,
+ _ptr: Pointer<Tag>,
+ _size: Size,
+ ) -> EvalResult<'tcx> {
+ Ok(())
+ }
}
impl AllocationExtra<()> for () {}
dest: PlaceTy<'tcx, Self::PointerTag>,
) -> EvalResult<'tcx>;
- /// Hook for performing extra checks when memory gets deallocated.
- #[inline]
- fn memory_deallocated(
- _alloc: &mut Allocation<Self::PointerTag, Self::AllocExtra>,
- _ptr: Pointer<Self::PointerTag>,
- _size: Size,
- ) -> EvalResult<'tcx> {
- Ok(())
- }
-
/// Add the tag for a newly allocated pointer.
fn tag_new_allocation(
ecx: &mut EvalContext<'a, 'mir, 'tcx, Self>,
// Let the machine take some extra action
let size = Size::from_bytes(alloc.bytes.len() as u64);
- M::memory_deallocated(&mut alloc, ptr, size)?;
+ AllocationExtra::memory_deallocated(&mut alloc, ptr, size)?;
// Don't forget to remember size and align of this now-dead allocation
let old = self.dead_alloc_map.insert(