diff options
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/rt/global_heap.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/libstd/rt/global_heap.rs b/src/libstd/rt/global_heap.rs index 5d4ac37055c..f669dc753d6 100644 --- a/src/libstd/rt/global_heap.rs +++ b/src/libstd/rt/global_heap.rs @@ -73,6 +73,20 @@ pub unsafe fn exchange_malloc(td: *c_char, size: uintptr_t) -> *c_char { assert!(td.is_not_null()); let total_size = get_box_size(size, (*td).align); + malloc_raw(total_size as uint) as *c_char +} + +// FIXME: #7496 +#[cfg(not(test))] +#[lang="closure_exchange_malloc"] +#[inline] +pub unsafe fn closure_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; |
