initial port of the exchange allocator to jemalloc

In stage0, all allocations are 8-byte aligned. Passing a size and
alignment to free is not yet implemented everywhere (0 size and 8 align
are used as placeholders). Fixing this is part of #13994.

Closes #13616
This commit is contained in:
Daniel Micay
2014-05-06 22:03:14 -04:00
parent aaf6e06b01
commit 138437956c
11 changed files with 219 additions and 151 deletions

View File

@@ -1512,7 +1512,7 @@ impl<T> FromVec<T> for ~[T] {
let vp = v.as_mut_ptr();
unsafe {
let ret = malloc_raw(size) as *mut RawVec<()>;
let ret = allocate(size, 8) as *mut RawVec<()>;
(*ret).fill = len * mem::nonzero_size_of::<T>();
(*ret).alloc = len * mem::nonzero_size_of::<T>();