diff options
| author | Graydon Hoare <[email protected]> | 2010-11-09 14:15:07 -0800 |
|---|---|---|
| committer | Graydon Hoare <[email protected]> | 2010-11-09 14:15:07 -0800 |
| commit | 89946609f2de815ea87df3b001fff0caf9efa0d5 (patch) | |
| tree | 0945861dddd480b822827d77205f90584d0c2586 /src/rt/rust_internal.h | |
| parent | Add a check for binding an alias. Good thing, as we had two instances in our ... (diff) | |
| download | rust-89946609f2de815ea87df3b001fff0caf9efa0d5.tar.xz rust-89946609f2de815ea87df3b001fff0caf9efa0d5.zip | |
Support a special const-value refcount, use it for const strings.
Diffstat (limited to 'src/rt/rust_internal.h')
| -rw-r--r-- | src/rt/rust_internal.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/rt/rust_internal.h b/src/rt/rust_internal.h index d1eec48b..f008d9f6 100644 --- a/src/rt/rust_internal.h +++ b/src/rt/rust_internal.h @@ -81,6 +81,13 @@ struct frame_glue_fns; 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; + // Every reference counted object should derive from this base class. template <typename T> struct rc_base { |