diff options
| author | Graydon Hoare <[email protected]> | 2010-11-09 14:15:07 -0800 |
|---|---|---|
| committer | Graydon Hoare <[email protected]> | 2010-11-09 14:15:07 -0800 |
| commit | 89946609f2de815ea87df3b001fff0caf9efa0d5 (patch) | |
| tree | 0945861dddd480b822827d77205f90584d0c2586 /src/rt/rust_upcall.cpp | |
| parent | Add a check for binding an alias. Good thing, as we had two instances in our ... (diff) | |
| download | rust-89946609f2de815ea87df3b001fff0caf9efa0d5.tar.xz rust-89946609f2de815ea87df3b001fff0caf9efa0d5.zip | |
Support a special const-value refcount, use it for const strings.
Diffstat (limited to 'src/rt/rust_upcall.cpp')
| -rw-r--r-- | src/rt/rust_upcall.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/rt/rust_upcall.cpp b/src/rt/rust_upcall.cpp index 9742b22a..ebf81faf 100644 --- a/src/rt/rust_upcall.cpp +++ b/src/rt/rust_upcall.cpp @@ -424,7 +424,10 @@ upcall_vec_grow(rust_task *task, task->fail(4); return NULL; } - v->deref(); + + if (v->ref_count != CONST_REFCOUNT) + v->deref(); + v = new (mem) rust_vec(dom, alloc, 0, NULL); *need_copy = 1; } |