From 89946609f2de815ea87df3b001fff0caf9efa0d5 Mon Sep 17 00:00:00 2001 From: Graydon Hoare Date: Tue, 9 Nov 2010 14:15:07 -0800 Subject: Support a special const-value refcount, use it for const strings. --- src/rt/rust_upcall.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/rt/rust_upcall.cpp') 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; } -- cgit v1.2.3