stop initializing ref_count in exchange_alloc
this is never read anymore
This commit is contained in:
parent
350a5c0b72
commit
408eef0d89
@ -43,6 +43,27 @@ pub unsafe fn malloc_raw(size: uint) -> *c_void {
|
||||
}
|
||||
|
||||
// FIXME #4942: Make these signatures agree with exchange_alloc's signatures
|
||||
#[cfg(stage0, not(test))]
|
||||
#[lang="exchange_malloc"]
|
||||
#[inline]
|
||||
pub unsafe fn exchange_malloc(td: *c_char, size: uintptr_t) -> *c_char {
|
||||
let td = td as *TyDesc;
|
||||
let size = size as uint;
|
||||
|
||||
assert!(td.is_not_null());
|
||||
|
||||
let total_size = get_box_size(size, (*td).align);
|
||||
let p = malloc_raw(total_size as uint);
|
||||
|
||||
let box: *mut BoxRepr = p as *mut BoxRepr;
|
||||
(*box).header.ref_count = -1;
|
||||
(*box).header.type_desc = td;
|
||||
|
||||
box as *c_char
|
||||
}
|
||||
|
||||
// FIXME #4942: Make these signatures agree with exchange_alloc's signatures
|
||||
#[cfg(not(stage0), not(test))]
|
||||
#[lang="exchange_malloc"]
|
||||
#[inline]
|
||||
pub unsafe fn exchange_malloc(td: *c_char, size: uintptr_t) -> *c_char {
|
||||
@ -55,7 +76,6 @@ pub unsafe fn exchange_malloc(td: *c_char, size: uintptr_t) -> *c_char {
|
||||
let p = malloc_raw(total_size as uint);
|
||||
|
||||
let box: *mut BoxRepr = p as *mut BoxRepr;
|
||||
(*box).header.ref_count = -1; // Exchange values not ref counted
|
||||
(*box).header.type_desc = td;
|
||||
|
||||
box as *c_char
|
||||
|
Loading…
x
Reference in New Issue
Block a user