@@ -24,16 +24,14 @@ use std::sync::Mutex;
2424use std:: sync:: atomic:: AtomicIsize ;
2525use std:: sync:: atomic:: Ordering :: SeqCst ;
2626
27- use self :: repr :: { UnpackedAtom , Static , Inline , Dynamic } ;
27+ use string_cache_shared :: { self , UnpackedAtom , Static , Inline , Dynamic } ;
2828
2929#[ cfg( feature = "log-events" ) ]
3030use event:: Event ;
3131
3232#[ cfg( not( feature = "log-events" ) ) ]
3333macro_rules! log ( ( $e: expr) => ( ( ) ) ) ;
3434
35- #[ path="../../shared/repr.rs" ]
36- pub mod repr;
3735
3836// Needed for memory safety of the tagging scheme!
3937const ENTRY_ALIGNMENT : usize = 16 ;
@@ -178,7 +176,7 @@ impl Atom {
178176 Some ( id) => Static ( id as u32 ) ,
179177 None => {
180178 let len = string_to_add. len ( ) ;
181- if len <= repr :: MAX_INLINE_LEN {
179+ if len <= string_cache_shared :: MAX_INLINE_LEN {
182180 let mut buf: [ u8 ; 7 ] = [ 0 ; 7 ] ;
183181 bytes:: copy_memory ( string_to_add. as_bytes ( ) , & mut buf) ;
184182 Inline ( len as u8 , buf)
@@ -198,7 +196,7 @@ impl Atom {
198196 unsafe {
199197 match self . unpack ( ) {
200198 Inline ( ..) => {
201- let buf = repr :: inline_orig_bytes ( & self . data ) ;
199+ let buf = string_cache_shared :: inline_orig_bytes ( & self . data ) ;
202200 str:: from_utf8 ( buf) . unwrap ( )
203201 } ,
204202 Static ( idx) => * static_atom_set. index ( idx as usize ) . expect ( "bad static atom" ) ,
@@ -215,7 +213,7 @@ impl Clone for Atom {
215213 #[ inline( always) ]
216214 fn clone ( & self ) -> Atom {
217215 unsafe {
218- match repr :: from_packed_dynamic ( self . data ) {
216+ match string_cache_shared :: from_packed_dynamic ( self . data ) {
219217 Some ( entry) => {
220218 let entry = entry as * mut StringCacheEntry ;
221219 ( * entry) . ref_count . fetch_add ( 1 , SeqCst ) ;
@@ -238,7 +236,7 @@ impl Drop for Atom {
238236 }
239237
240238 unsafe {
241- match repr :: from_packed_dynamic ( self . data ) {
239+ match string_cache_shared :: from_packed_dynamic ( self . data ) {
242240 // We use #[unsafe_no_drop_flag] so that Atom will be only 64
243241 // bits. That means we need to ignore a NULL pointer here,
244242 // which represents a value that was moved out.
@@ -312,7 +310,7 @@ mod bench;
312310mod tests {
313311 use std:: thread;
314312 use super :: Atom ;
315- use super :: repr :: { Static , Inline , Dynamic } ;
313+ use string_cache_shared :: { Static , Inline , Dynamic } ;
316314
317315 #[ test]
318316 fn test_as_slice ( ) {
0 commit comments