diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2013-07-21 17:20:52 -0700 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2013-07-26 09:53:03 -0700 |
| commit | 5aaaca0c6a837ef60260b07121f4b4c4984afc70 (patch) | |
| tree | 69fd81f9f8669b681f5cb8d7382485045b96539d /src/libstd/managed.rs | |
| parent | 7fd23e4fe26bc9d6eef9596593ba3ddbe83f4a10 (diff) | |
Consolidate raw representations of rust values
This moves the raw struct layout of closures, vectors, boxes, and strings into a new `unstable::raw` module. This is meant to be a centralized location to find information for the layout of these values. As safe method, `repr`, is provided to convert a rust value to its raw representation. Unsafe methods to convert back are not provided because they are rarely used and too numerous to write an implementation for each (not much of a common pattern).
Diffstat (limited to 'src/libstd/managed.rs')
| -rw-r--r-- | src/libstd/managed.rs | 23 |
1 files changed, 2 insertions, 21 deletions
diff --git a/src/libstd/managed.rs b/src/libstd/managed.rs index 2c9fcb2999f..bd4dc69537c 100644 --- a/src/libstd/managed.rs +++ b/src/libstd/managed.rs @@ -14,27 +14,8 @@ use ptr::to_unsafe_ptr; #[cfg(not(test))] use cmp::{Eq, Ord}; -pub mod raw { - use std::unstable::intrinsics::TyDesc; - - pub static RC_MANAGED_UNIQUE : uint = (-2) as uint; - pub static RC_IMMORTAL : uint = 0x77777777; - - #[allow(missing_doc)] - pub struct BoxHeaderRepr { - ref_count: uint, - type_desc: *TyDesc, - prev: *BoxRepr, - next: *BoxRepr, - } - - #[allow(missing_doc)] - pub struct BoxRepr { - header: BoxHeaderRepr, - data: u8 - } - -} +pub static RC_MANAGED_UNIQUE : uint = (-2) as uint; +pub static RC_IMMORTAL : uint = 0x77777777; /// Determine if two shared boxes point to the same object #[inline] |
