diff options
| author | Graydon Hoare <graydon@mozilla.com> | 2010-11-09 14:15:07 -0800 |
|---|---|---|
| committer | Graydon Hoare <graydon@mozilla.com> | 2010-11-09 14:15:07 -0800 |
| commit | 89946609f2de815ea87df3b001fff0caf9efa0d5 (patch) | |
| tree | 0945861dddd480b822827d77205f90584d0c2586 /src/rt/rust_upcall.cpp | |
| parent | 3e9be14757bfcaa65e388a9acd7e2ca97cccfbd0 (diff) | |
| download | rust-89946609f2de815ea87df3b001fff0caf9efa0d5.tar.gz 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 9742b22af78..ebf81faf3ac 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; } |
