fn compute_struct_field_offsets<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>,
                                          st: &Struct<'tcx>) -> Vec<u64> {
    let mut offsets = vec!();

    let mut offset = 0;
    for &ty in &st.fields {
        let llty = type_of::sizing_type_of(ccx, ty);
        if !st.packed {
            let type_align = type_of::align_of(ccx, ty);
            offset = roundup(offset, type_align);
        }
        offsets.push(offset);
        offset += machine::llsize_of_alloc(ccx, llty);
    }
    assert_eq!(st.fields.len(), offsets.len());
    offsets
}
/// Compute struct field offsets relative to struct begin.
Compute struct field offsets relative to struct begin.
Compute struct field offsets relative to struct begin .
fn compute_struct_field_offsets<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>,
                                          st: &Struct<'tcx>) -> Vec<u64> {
    let mut offsets = vec!();
    let mut offset = 0;
    for &ty in &st.fields {
        let llty = type_of::sizing_type_of(ccx, ty);
        if !st.packed {
            let type_align = type_of::align_of(ccx, ty);
            offset = roundup(offset, type_align);
        }
        offsets.push(offset);
        offset += machine::llsize_of_alloc(ccx, llty);
    }
    assert_eq!(st.fields.len(), offsets.len());
    offsets
}
fn compute_struct_field_offsets < ' a , ' tcx > ( ccx : & CrateContext < ' a , ' tcx > , st : & Struct < ' tcx > ) -> Vec < u64 > { let mut offsets = vec ! ( ) ; let mut offset = 0 ; for & ty in & st . fields { let llty = type_of :: sizing_type_of ( ccx , ty ) ; if ! st . packed { let type_align = type_of :: align_of ( ccx , ty ) ; offset = roundup ( offset , type_align ) ; } offsets . push ( offset ) ; offset += machine :: llsize_of_alloc ( ccx , llty ) ; } assert_eq ! ( st fields len ( ) offsets len ( ) ) ; offsets }
Compute struct field offsets relative to struct begin.
Compute struct field offsets relative to struct begin .
ccx
&CrateContext<'a, 'tcx>
st
&Struct<'tcx>
ccx
&CrateContext<'a, 'tcx>
st
&Struct<'tcx>