diff options
| author | Brian Anderson <banderson@mozilla.com> | 2011-09-02 12:21:01 -0700 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2011-09-02 15:13:41 -0700 |
| commit | 72c14d5a4108e91dcdce17c8ccc6f7953fde8a70 (patch) | |
| tree | 099f4e7f99b10f0033784b0b0265a1dc9a298d7f /src/rt | |
| parent | 99ee0fca6722bc8b78032605c2f6243340f6b04e (diff) | |
| download | rust-72c14d5a4108e91dcdce17c8ccc6f7953fde8a70.tar.gz rust-72c14d5a4108e91dcdce17c8ccc6f7953fde8a70.zip | |
Eliminate const_refcount. Issue #855
Diffstat (limited to 'src/rt')
| -rw-r--r-- | src/rt/rust_builtin.cpp | 7 | ||||
| -rw-r--r-- | src/rt/rust_internal.h | 7 |
2 files changed, 1 insertions, 13 deletions
diff --git a/src/rt/rust_builtin.cpp b/src/rt/rust_builtin.cpp index 814822e8f1e..0ed30a8cbf6 100644 --- a/src/rt/rust_builtin.cpp +++ b/src/rt/rust_builtin.cpp @@ -90,9 +90,6 @@ leak(rust_task *task, type_desc *t, void *thing) { extern "C" CDECL intptr_t refcount(rust_task *task, type_desc *t, intptr_t *v) { - if (*v == CONST_REFCOUNT) - return CONST_REFCOUNT; - // Passed-in value has refcount 1 too high // because it was ref'ed while making the call. return (*v) - 1; @@ -249,9 +246,7 @@ debug_box(rust_task *task, type_desc *t, rust_box *box) LOG(task, stdlib, "debug_box(0x%" PRIxPTR ")", box); debug_tydesc_helper(task, t); LOG(task, stdlib, " refcount %" PRIdPTR, - box->ref_count == CONST_REFCOUNT - ? CONST_REFCOUNT - : box->ref_count - 1); // -1 because we ref'ed for this call + box->ref_count - 1); // -1 because we ref'ed for this call for (uintptr_t i = 0; i < t->size; ++i) { LOG(task, stdlib, " byte %" PRIdPTR ": 0x%" PRIx8, i, box->data[i]); } diff --git a/src/rt/rust_internal.h b/src/rt/rust_internal.h index 4a5d208915d..d2c8574280b 100644 --- a/src/rt/rust_internal.h +++ b/src/rt/rust_internal.h @@ -95,13 +95,6 @@ struct chan_handle { static size_t const TIME_SLICE_IN_MS = 10; -// Since every refcounted object is > 4 bytes, any refcount with any of the -// top two bits set is invalid. We reserve a particular bit pattern in this -// set for indicating objects that are "constant" as far as the memory model -// knows. - -static intptr_t const CONST_REFCOUNT = 0x7badface; - // This accounts for logging buffers. static size_t const BUF_BYTES = 2048; |
