Skip to content

Commit

Permalink
Rename a few functions for consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
osa1 committed Aug 24, 2020
1 parent c529eb2 commit 6aa9e65
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions rts/motoko-rts/src/gc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ unsafe fn memset(s: usize, c: Words<u32>, b: u32) {
///
/// - ptr_loc: Location of the object to evacuate, e.g. an object field address.
///
unsafe fn evacuate(
unsafe fn evac(
begin_from_space: usize,
begin_to_space: usize,
end_to_space: usize,
Expand Down Expand Up @@ -206,7 +206,7 @@ unsafe fn evacuate(
///
/// - `ptr_loc`: Address of a `data_ptr` field of a BigInt (see types.rs). Points to payload of a
/// blob. See types.rs for blob layout.
unsafe fn evacuate_bigint_blob(
unsafe fn evac_bigint_blob(
begin_from_space: usize,
begin_to_space: usize,
end_to_space: usize,
Expand All @@ -220,7 +220,7 @@ unsafe fn evacuate_bigint_blob(
let blob_obj_addr_field = &mut blob_obj_addr;
let blob_obj_addr_field_ptr = blob_obj_addr_field as *mut _;

let ret = evacuate(
let ret = evac(
begin_from_space,
begin_to_space,
end_to_space,
Expand Down Expand Up @@ -250,7 +250,7 @@ unsafe fn scav(
let obj = obj as *mut Object;
let obj_payload = obj.offset(1) as *mut SkewedPtr;
for i in 0..(*obj).size as isize {
end_to_space = evacuate(
end_to_space = evac(
begin_from_space,
begin_to_space,
end_to_space,
Expand All @@ -263,7 +263,7 @@ unsafe fn scav(
let array = obj as *mut Array;
let array_payload = array.offset(1) as *mut SkewedPtr;
for i in 0..(*array).len as isize {
end_to_space = evacuate(
end_to_space = evac(
begin_from_space,
begin_to_space,
end_to_space,
Expand All @@ -275,14 +275,14 @@ unsafe fn scav(
TAG_MUTBOX => {
let mutbox = obj as *mut MutBox;
let field_addr = ((&mut (*mutbox).field) as *mut _) as usize;
end_to_space = evacuate(begin_from_space, begin_to_space, end_to_space, field_addr);
end_to_space = evac(begin_from_space, begin_to_space, end_to_space, field_addr);
}

TAG_CLOSURE => {
let closure = obj as *mut Closure;
let closure_payload = closure.offset(1) as *mut SkewedPtr;
for i in 0..(*closure).size as isize {
end_to_space = evacuate(
end_to_space = evac(
begin_from_space,
begin_to_space,
end_to_space,
Expand All @@ -294,20 +294,20 @@ unsafe fn scav(
TAG_SOME => {
let some = obj as *mut Some;
let field_addr = ((&mut (*some).field) as *mut _) as usize;
end_to_space = evacuate(begin_from_space, begin_to_space, end_to_space, field_addr);
end_to_space = evac(begin_from_space, begin_to_space, end_to_space, field_addr);
}

TAG_VARIANT => {
let variant = obj as *mut Variant;
let field_addr = ((&mut (*variant).field) as *mut _) as usize;
end_to_space = evacuate(begin_from_space, begin_to_space, end_to_space, field_addr);
end_to_space = evac(begin_from_space, begin_to_space, end_to_space, field_addr);
}

TAG_BIGINT => {
let bigint = obj as *mut BigInt;
let data_ptr_addr = (&mut (*bigint).data_ptr) as *mut _;

end_to_space = evacuate_bigint_blob(
end_to_space = evac_bigint_blob(
begin_from_space,
begin_to_space,
end_to_space,
Expand All @@ -318,14 +318,14 @@ unsafe fn scav(
TAG_CONCAT => {
let concat = obj as *mut Concat;
let field1_addr = ((&mut (*concat).text1) as *mut _) as usize;
end_to_space = evacuate(begin_from_space, begin_to_space, end_to_space, field1_addr);
end_to_space = evac(begin_from_space, begin_to_space, end_to_space, field1_addr);
let field2_addr = ((&mut (*concat).text2) as *mut _) as usize;
end_to_space = evacuate(begin_from_space, begin_to_space, end_to_space, field2_addr);
end_to_space = evac(begin_from_space, begin_to_space, end_to_space, field2_addr);
}

TAG_OBJ_IND => {
let field_addr = obj.offset(1) as usize;
end_to_space = evacuate(begin_from_space, begin_to_space, end_to_space, field_addr);
end_to_space = evac(begin_from_space, begin_to_space, end_to_space, field_addr);
}

TAG_BITS64 | TAG_BITS32 | TAG_BLOB => {
Expand Down Expand Up @@ -376,7 +376,7 @@ pub unsafe extern "C" fn collect() {
// Evacuate roots
end_to_space = evac_static_roots(begin_from_space, begin_to_space, end_to_space, static_roots);

end_to_space = evacuate(
end_to_space = evac(
begin_from_space,
begin_to_space,
end_to_space,
Expand Down

0 comments on commit 6aa9e65

Please sign in to comment.