diff options
| author | Brian Anderson <banderson@mozilla.com> | 2013-08-09 23:16:51 -0700 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2013-08-16 13:24:25 -0700 |
| commit | 8861ba6159fb93839c9c7d778aa26f0316f6b717 (patch) | |
| tree | 0f2cf2e00b53910719e7a6182e1873028f4b7f28 /src | |
| parent | cb89afc64eb9ee65ab57d5758601f969368d251b (diff) | |
| download | rust-8861ba6159fb93839c9c7d778aa26f0316f6b717.tar.gz rust-8861ba6159fb93839c9c7d778aa26f0316f6b717.zip | |
rt: Remove rust_refcount.h
Diffstat (limited to 'src')
| -rw-r--r-- | src/rt/rust_refcount.h | 31 | ||||
| -rw-r--r-- | src/rt/rust_type.h | 3 |
2 files changed, 2 insertions, 32 deletions
diff --git a/src/rt/rust_refcount.h b/src/rt/rust_refcount.h deleted file mode 100644 index 1ed05ec8339..00000000000 --- a/src/rt/rust_refcount.h +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright 2012 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or -// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license -// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - - -#ifndef RUST_REFCOUNT_H -#define RUST_REFCOUNT_H - -#include "sync/sync.h" - -// Refcounting defines -typedef unsigned long ref_cnt_t; - -#define RUST_ATOMIC_REFCOUNT() \ -private: \ - intptr_t ref_count; \ -public: \ - void ref() { \ - intptr_t old = sync::increment(ref_count); \ - assert(old > 0); \ - } \ - void deref() { if(0 == sync::decrement(ref_count)) { delete_this(); } } \ - intptr_t get_ref_count() { return sync::read(ref_count); } - -#endif diff --git a/src/rt/rust_type.h b/src/rt/rust_type.h index 57538f1ec75..abe9a90c5fd 100644 --- a/src/rt/rust_type.h +++ b/src/rt/rust_type.h @@ -13,7 +13,6 @@ #define RUST_TYPE_H #include "rust_globals.h" -#include "rust_refcount.h" struct rust_opaque_box; @@ -28,6 +27,8 @@ struct type_desc; typedef void CDECL (glue_fn)(void *, void *); +typedef unsigned long ref_cnt_t; + // Corresponds to the boxed data in the @ region. The body follows the // header; you can obtain a ptr via box_body() below. struct rust_opaque_box { |
