Turn flow::base and friends into methods

This commit is contained in:
Matt Brubeck 2017-12-14 10:57:34 -06:00
parent 26feea3be5
commit c60cfc5a9f
20 changed files with 211 additions and 212 deletions

View file

@ -10,7 +10,7 @@
use block::BlockFlow;
use context::LayoutContext;
use flow::{self, Flow};
use flow::{Flow, GetBaseFlow};
use flow_ref::FlowRef;
use profile_traits::time::{self, TimerMetadata, profile};
use rayon;
@ -84,7 +84,7 @@ fn bottom_up_flow(mut unsafe_flow: UnsafeFlow,
}
let base = flow::mut_base(flow);
let base = flow.mut_base();
// Reset the count of children for the next layout traversal.
base.parallel.children_count.store(base.children.len() as isize,
@ -103,7 +103,7 @@ fn bottom_up_flow(mut unsafe_flow: UnsafeFlow,
let parent: &mut Flow = unsafe {
&mut *(unsafe_parent.0 as *mut Flow)
};
let parent_base = flow::mut_base(parent);
let parent_base = parent.mut_base();
if parent_base.parallel.children_count.fetch_sub(1, Ordering::Relaxed) == 1 {
// We were the last child of our parent. Reflow our parent.
unsafe_flow = unsafe_parent
@ -127,7 +127,7 @@ fn top_down_flow<'scope>(unsafe_flows: &[UnsafeFlow],
unsafe {
// Get a real flow.
let flow: &mut Flow = mem::transmute(*unsafe_flow);
flow::mut_base(flow).thread_id =
flow.mut_base().thread_id =
pool.current_thread_index().unwrap() as u8;
if assign_isize_traversal.should_process(flow) {
@ -136,7 +136,7 @@ fn top_down_flow<'scope>(unsafe_flows: &[UnsafeFlow],
}
// Possibly enqueue the children.
for kid in flow::child_iter_mut(flow) {
for kid in flow.mut_base().child_iter_mut() {
had_children = true;
discovered_child_flows.push(UnsafeFlow(kid));
}