diff options
| author | Patrick Walton <pcwalton@mimiga.net> | 2011-09-20 15:35:14 -0700 |
|---|---|---|
| committer | Patrick Walton <pcwalton@mimiga.net> | 2011-09-20 15:35:14 -0700 |
| commit | 77f0101edb85c574a94e15aa862ca075ed2fb886 (patch) | |
| tree | e805abe57ca87d1e63c9092d940914d41bbbba3f /src/rt/rust_upcall.cpp | |
| parent | 5209b192558e4adf0baa0981c463dcff61ec0636 (diff) | |
| download | rust-77f0101edb85c574a94e15aa862ca075ed2fb886.tar.gz rust-77f0101edb85c574a94e15aa862ca075ed2fb886.zip | |
rt: Add an on-the-side GC chain
Diffstat (limited to 'src/rt/rust_upcall.cpp')
| -rw-r--r-- | src/rt/rust_upcall.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/rt/rust_upcall.cpp b/src/rt/rust_upcall.cpp index 79291bdd3a3..5fabb5cd1ab 100644 --- a/src/rt/rust_upcall.cpp +++ b/src/rt/rust_upcall.cpp @@ -67,6 +67,8 @@ upcall_malloc(rust_task *task, size_t nbytes, type_desc *td) { void *p = task->malloc(nbytes, "tdesc", td); + task->local_allocs[p] = td; + LOG(task, mem, "upcall malloc(%" PRIdPTR ", 0x%" PRIxPTR ") = 0x%" PRIxPTR, nbytes, td, (uintptr_t)p); @@ -84,6 +86,8 @@ upcall_free(rust_task *task, void* ptr, uintptr_t is_gc) { DLOG(sched, mem, "upcall free(0x%" PRIxPTR ", is_gc=%" PRIdPTR ")", (uintptr_t)ptr, is_gc); + + task->local_allocs.erase(ptr); task->free(ptr, (bool) is_gc); } |
