diff options
| author | Patrick Walton <pcwalton@mimiga.net> | 2011-08-31 19:19:05 -0700 |
|---|---|---|
| committer | Patrick Walton <pcwalton@mimiga.net> | 2011-08-31 19:19:05 -0700 |
| commit | 614a930c51d8e8f66e6893261616a449d9ab0754 (patch) | |
| tree | 5ec334ad863047aae11989bef8ad5d6ff1327129 /src/rt/rust_upcall.cpp | |
| parent | 729437d2c07cfaf3d924df59a9341b3ac2efa1d6 (diff) | |
| download | rust-614a930c51d8e8f66e6893261616a449d9ab0754.tar.gz rust-614a930c51d8e8f66e6893261616a449d9ab0754.zip | |
rt: Make the dynamic stack self-describing
Diffstat (limited to 'src/rt/rust_upcall.cpp')
| -rw-r--r-- | src/rt/rust_upcall.cpp | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/src/rt/rust_upcall.cpp b/src/rt/rust_upcall.cpp index 77c7cf1a113..98dd9136d9d 100644 --- a/src/rt/rust_upcall.cpp +++ b/src/rt/rust_upcall.cpp @@ -368,13 +368,26 @@ upcall_vec_push(rust_task* task, rust_vec** vp, type_desc* elt_ty, */ extern "C" CDECL void * upcall_dynastack_mark(rust_task *task) { - return task->dynastack.alloc(0); + return task->dynastack.mark(); } -/** Allocates space in the dynamic stack and returns it. */ +/** + * Allocates space in the dynamic stack and returns it. + * + * FIXME: Deprecated since dynamic stacks need to be self-describing for GC. + */ extern "C" CDECL void * upcall_dynastack_alloc(rust_task *task, size_t sz) { - return sz ? task->dynastack.alloc(sz) : NULL; + return sz ? task->dynastack.alloc(sz, NULL) : NULL; +} + +/** + * Allocates space associated with a type descriptor in the dynamic stack and + * returns it. + */ +extern "C" CDECL void * +upcall_dynastack_alloc_2(rust_task *task, size_t sz, type_desc *ty) { + return sz ? task->dynastack.alloc(sz, ty) : NULL; } /** Frees space in the dynamic stack. */ |
