Add a malloc_dyn upcall for dynamically sized allocations on the shared heap.

This commit is contained in:
Michael Sullivan 2012-06-13 17:59:21 -07:00
parent 31f4b63dff
commit 4c0d41cffa
7 changed files with 103 additions and 40 deletions

View file

@ -11,6 +11,7 @@ type upcalls =
{_fail: ValueRef,
trace: ValueRef,
malloc: ValueRef,
malloc_dyn: ValueRef,
free: ValueRef,
exchange_malloc: ValueRef,
exchange_malloc_dyn: ValueRef,
@ -58,6 +59,9 @@ fn declare_upcalls(targ_cfg: @session::config,
int_t]),
malloc:
nothrow(d("malloc", [T_ptr(tydesc_type)],
malloc_dyn:
nothrow(d("malloc_dyn",
[T_ptr(tydesc_type), int_t],
T_ptr(T_i8()))),
free:
nothrow(dv("free", [T_ptr(T_i8())])),