Merge pull request #522 from RalfJung/alloc-extra

update for memory_deallocated moving to AllocExtra
This commit is contained in:
Ralf Jung
2018-11-15 09:13:37 +01:00
committed by GitHub
3 changed files with 6 additions and 15 deletions
+1 -1
View File
@@ -1 +1 @@
nightly-2018-11-12
nightly-2018-11-15
-9
View File
@@ -446,15 +446,6 @@ fn adjust_static_allocation(
Cow::Owned(alloc)
}
#[inline(always)]
fn memory_deallocated(
alloc: &mut Allocation<Borrow, Self::AllocExtra>,
ptr: Pointer<Borrow>,
size: Size,
) -> EvalResult<'tcx> {
alloc.extra.memory_deallocated(ptr, size)
}
#[inline(always)]
fn tag_reference(
ecx: &mut EvalContext<'a, 'mir, 'tcx, Self>,
+5 -5
View File
@@ -363,20 +363,20 @@ fn memory_written<'tcx>(
// Writes behave exactly like the first half of a reborrow-to-mut
alloc.extra.use_and_maybe_re_borrow(ptr, size, UsageKind::Write, None)
}
}
impl<'tcx> Stacks {
#[inline(always)]
pub fn memory_deallocated(
&mut self,
fn memory_deallocated<'tcx>(
alloc: &mut Allocation<Borrow, Stacks>,
ptr: Pointer<Borrow>,
size: Size,
) -> EvalResult<'tcx> {
// This is like mutating
self.use_and_maybe_re_borrow(ptr, size, UsageKind::Write, None)
alloc.extra.use_and_maybe_re_borrow(ptr, size, UsageKind::Write, None)
// FIXME: Error out of there are any barriers?
}
}
impl<'tcx> Stacks {
/// Pushes the first item to the stacks.
pub fn first_item(
&mut self,