Skip to content

Commit 3554d1a

Browse files
authored
Merge pull request #522 from RalfJung/alloc-extra
update for memory_deallocated moving to AllocExtra
2 parents 2e6eb00 + 5120abc commit 3554d1a

File tree

3 files changed

+6
-15
lines changed

3 files changed

+6
-15
lines changed

rust-version

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
nightly-2018-11-12
1+
nightly-2018-11-15

src/lib.rs

-9
Original file line numberDiff line numberDiff line change
@@ -446,15 +446,6 @@ impl<'a, 'mir, 'tcx> Machine<'a, 'mir, 'tcx> for Evaluator<'tcx> {
446446
Cow::Owned(alloc)
447447
}
448448

449-
#[inline(always)]
450-
fn memory_deallocated(
451-
alloc: &mut Allocation<Borrow, Self::AllocExtra>,
452-
ptr: Pointer<Borrow>,
453-
size: Size,
454-
) -> EvalResult<'tcx> {
455-
alloc.extra.memory_deallocated(ptr, size)
456-
}
457-
458449
#[inline(always)]
459450
fn tag_reference(
460451
ecx: &mut EvalContext<'a, 'mir, 'tcx, Self>,

src/stacked_borrows.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -363,20 +363,20 @@ impl AllocationExtra<Borrow> for Stacks {
363363
// Writes behave exactly like the first half of a reborrow-to-mut
364364
alloc.extra.use_and_maybe_re_borrow(ptr, size, UsageKind::Write, None)
365365
}
366-
}
367366

368-
impl<'tcx> Stacks {
369367
#[inline(always)]
370-
pub fn memory_deallocated(
371-
&mut self,
368+
fn memory_deallocated<'tcx>(
369+
alloc: &mut Allocation<Borrow, Stacks>,
372370
ptr: Pointer<Borrow>,
373371
size: Size,
374372
) -> EvalResult<'tcx> {
375373
// This is like mutating
376-
self.use_and_maybe_re_borrow(ptr, size, UsageKind::Write, None)
374+
alloc.extra.use_and_maybe_re_borrow(ptr, size, UsageKind::Write, None)
377375
// FIXME: Error out of there are any barriers?
378376
}
377+
}
379378

379+
impl<'tcx> Stacks {
380380
/// Pushes the first item to the stacks.
381381
pub fn first_item(
382382
&mut self,

0 commit comments

Comments
 (0)