Skip to content

Rename memory hooks #2488

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion rust-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2fbc08e2ce64dee45a29cb6133da6b32366268aa
8556e6620e4866526b3cea767ad8c20ae877a569
12 changes: 6 additions & 6 deletions src/machine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -780,7 +780,7 @@ impl<'mir, 'tcx> Machine<'mir, 'tcx> for Evaluator<'mir, 'tcx> {
}

#[inline(always)]
fn memory_read(
fn before_memory_read(
_tcx: TyCtxt<'tcx>,
machine: &Self,
alloc_extra: &AllocExtra,
Expand All @@ -796,7 +796,7 @@ impl<'mir, 'tcx> Machine<'mir, 'tcx> for Evaluator<'mir, 'tcx> {
)?;
}
if let Some(stacked_borrows) = &alloc_extra.stacked_borrows {
stacked_borrows.borrow_mut().memory_read(
stacked_borrows.borrow_mut().before_memory_read(
alloc_id,
prov_extra,
range,
Expand All @@ -812,7 +812,7 @@ impl<'mir, 'tcx> Machine<'mir, 'tcx> for Evaluator<'mir, 'tcx> {
}

#[inline(always)]
fn memory_written(
fn before_memory_write(
_tcx: TyCtxt<'tcx>,
machine: &mut Self,
alloc_extra: &mut AllocExtra,
Expand All @@ -828,7 +828,7 @@ impl<'mir, 'tcx> Machine<'mir, 'tcx> for Evaluator<'mir, 'tcx> {
)?;
}
if let Some(stacked_borrows) = &mut alloc_extra.stacked_borrows {
stacked_borrows.get_mut().memory_written(
stacked_borrows.get_mut().before_memory_write(
alloc_id,
prov_extra,
range,
Expand All @@ -844,7 +844,7 @@ impl<'mir, 'tcx> Machine<'mir, 'tcx> for Evaluator<'mir, 'tcx> {
}

#[inline(always)]
fn memory_deallocated(
fn before_memory_deallocation(
_tcx: TyCtxt<'tcx>,
machine: &mut Self,
alloc_extra: &mut AllocExtra,
Expand All @@ -863,7 +863,7 @@ impl<'mir, 'tcx> Machine<'mir, 'tcx> for Evaluator<'mir, 'tcx> {
)?;
}
if let Some(stacked_borrows) = &mut alloc_extra.stacked_borrows {
stacked_borrows.get_mut().memory_deallocated(
stacked_borrows.get_mut().before_memory_deallocation(
alloc_id,
prove_extra,
range,
Expand Down
6 changes: 3 additions & 3 deletions src/stacked_borrows/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -657,7 +657,7 @@ impl Stacks {
}

#[inline(always)]
pub fn memory_read<'tcx>(
pub fn before_memory_read<'tcx>(
&mut self,
alloc_id: AllocId,
tag: ProvenanceExtra,
Expand Down Expand Up @@ -688,7 +688,7 @@ impl Stacks {
}

#[inline(always)]
pub fn memory_written<'tcx>(
pub fn before_memory_write<'tcx>(
&mut self,
alloc_id: AllocId,
tag: ProvenanceExtra,
Expand Down Expand Up @@ -719,7 +719,7 @@ impl Stacks {
}

#[inline(always)]
pub fn memory_deallocated<'tcx>(
pub fn before_memory_deallocation<'tcx>(
&mut self,
alloc_id: AllocId,
tag: ProvenanceExtra,
Expand Down