fn memzero(b: &Builder, llptr: ValueRef, ty: Type) {
    let _icx = push_ctxt("memzero");
    let ccx = b.ccx;

    let intrinsic_key = match ccx.sess.targ_cfg.arch {
        X86 | Arm | Mips => "llvm.memset.p0i8.i32",
        X86_64 => "llvm.memset.p0i8.i64"
    };

    let llintrinsicfn = ccx.intrinsics.get_copy(&intrinsic_key);
    let llptr = b.pointercast(llptr, Type::i8().ptr_to());
    let llzeroval = C_u8(0);
    let size = machine::llsize_of(ccx, ty);
    let align = C_i32(llalign_of_min(ccx, ty) as i32);
    let volatile = C_i1(false);
    b.call(llintrinsicfn, [llptr, llzeroval, size, align, volatile], []);
}
// Always use this function instead of storing a zero constant to the memory
// in question. If you store a zero constant, LLVM will drown in vreg
// allocation for large data structures, and the generated code will be
// awful. (A telltale sign of this is large quantities of
// `mov [byte ptr foo],0` in the generated code.)
Always use this function instead of storing a zero constant to the memory
in question. If you store a zero constant, LLVM will drown in vreg
allocation for large data structures, and the generated code will be
awful. (A telltale sign of this is large quantities of
`mov [byte ptr foo],0` in the generated code.)
Always use this function instead of storing a zero constant to the memory in question . If you store a zero constant LLVM will drown in vreg allocation for large data structures and the generated code will be awful . ( A telltale sign of this is large quantities of ` mov [ byte ptr foo ] 0 ` in the generated code . )
fn memzero(b: &Builder, llptr: ValueRef, ty: Type) {
    let _icx = push_ctxt("memzero");
    let ccx = b.ccx;
    let intrinsic_key = match ccx.sess.targ_cfg.arch {
        X86 | Arm | Mips => "llvm.memset.p0i8.i32",
        X86_64 => "llvm.memset.p0i8.i64"
    };
    let llintrinsicfn = ccx.intrinsics.get_copy(&intrinsic_key);
    let llptr = b.pointercast(llptr, Type::i8().ptr_to());
    let llzeroval = C_u8(0);
    let size = machine::llsize_of(ccx, ty);
    let align = C_i32(llalign_of_min(ccx, ty) as i32);
    let volatile = C_i1(false);
    b.call(llintrinsicfn, [llptr, llzeroval, size, align, volatile], []);
}
fn memzero ( b : & Builder , llptr : ValueRef , ty : Type ) { let _icx = push_ctxt ( " " ) ; let ccx = b . ccx ; let intrinsic_key = match ccx . sess . targ_cfg . arch { X86 | Arm | Mips => " " , X86_64 => " " } ; let llintrinsicfn = ccx . intrinsics . get_copy ( & intrinsic_key ) ; let llptr = b . pointercast ( llptr , Type :: i8 ( ) . ptr_to ( ) ) ; let llzeroval = C_u8 ( 0 ) ; let size = machine :: llsize_of ( ccx , ty ) ; let align = C_i32 ( llalign_of_min ( ccx , ty ) as i32 ) ; let volatile = C_i1 ( false ) ; b . call ( llintrinsicfn , [ llptr , llzeroval , size , align , volatile ] , [ ] ) ; }
Always use this function instead of storing a zero constant to the memory
in question.
Always use this function instead of storing a zero constant to the memory in question .
b
&Builder
llptr
ValueRef
ty
Type
b
&Builder
llptr
ValueRef
ty
Type