about summary refs log tree commit diff
path: root/src/rt/rust_upcall.cpp
diff options
context:
space:
mode:
authorPatrick Walton <pcwalton@mimiga.net>2011-08-31 19:19:05 -0700
committerPatrick Walton <pcwalton@mimiga.net>2011-08-31 19:19:05 -0700
commit614a930c51d8e8f66e6893261616a449d9ab0754 (patch)
tree5ec334ad863047aae11989bef8ad5d6ff1327129 /src/rt/rust_upcall.cpp
parent729437d2c07cfaf3d924df59a9341b3ac2efa1d6 (diff)
downloadrust-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.cpp19
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. */