stop zeroing all exchange allocations
This commit is contained in:
parent
a8f039a085
commit
22e88d510f
@ -14,7 +14,7 @@ use c_malloc = libc::malloc;
|
|||||||
use c_free = libc::free;
|
use c_free = libc::free;
|
||||||
use managed::raw::{BoxHeaderRepr, BoxRepr};
|
use managed::raw::{BoxHeaderRepr, BoxRepr};
|
||||||
use cast::transmute;
|
use cast::transmute;
|
||||||
use ptr::{set_memory, null};
|
use ptr::null;
|
||||||
use intrinsic::TyDesc;
|
use intrinsic::TyDesc;
|
||||||
|
|
||||||
pub unsafe fn malloc(td: *TypeDesc, size: uint) -> *c_void {
|
pub unsafe fn malloc(td: *TypeDesc, size: uint) -> *c_void {
|
||||||
@ -25,10 +25,6 @@ pub unsafe fn malloc(td: *TypeDesc, size: uint) -> *c_void {
|
|||||||
let p = c_malloc(total_size as size_t);
|
let p = c_malloc(total_size as size_t);
|
||||||
assert p.is_not_null();
|
assert p.is_not_null();
|
||||||
|
|
||||||
// FIXME #4761: Would be very nice to not memset all allocations
|
|
||||||
let p: *mut u8 = transmute(p);
|
|
||||||
set_memory(p, 0, total_size);
|
|
||||||
|
|
||||||
// FIXME #3475: Converting between our two different tydesc types
|
// FIXME #3475: Converting between our two different tydesc types
|
||||||
let td: *TyDesc = transmute(td);
|
let td: *TyDesc = transmute(td);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user