@@ -24,16 +24,14 @@ use std::sync::Mutex;
24
24
use std:: sync:: atomic:: AtomicIsize ;
25
25
use std:: sync:: atomic:: Ordering :: SeqCst ;
26
26
27
- use self :: repr :: { UnpackedAtom , Static , Inline , Dynamic } ;
27
+ use string_cache_shared :: { self , UnpackedAtom , Static , Inline , Dynamic } ;
28
28
29
29
#[ cfg( feature = "log-events" ) ]
30
30
use event:: Event ;
31
31
32
32
#[ cfg( not( feature = "log-events" ) ) ]
33
33
macro_rules! log ( ( $e: expr) => ( ( ) ) ) ;
34
34
35
- #[ path="../../shared/repr.rs" ]
36
- pub mod repr;
37
35
38
36
// Needed for memory safety of the tagging scheme!
39
37
const ENTRY_ALIGNMENT : usize = 16 ;
@@ -178,7 +176,7 @@ impl Atom {
178
176
Some ( id) => Static ( id as u32 ) ,
179
177
None => {
180
178
let len = string_to_add. len ( ) ;
181
- if len <= repr :: MAX_INLINE_LEN {
179
+ if len <= string_cache_shared :: MAX_INLINE_LEN {
182
180
let mut buf: [ u8 ; 7 ] = [ 0 ; 7 ] ;
183
181
bytes:: copy_memory ( string_to_add. as_bytes ( ) , & mut buf) ;
184
182
Inline ( len as u8 , buf)
@@ -198,7 +196,7 @@ impl Atom {
198
196
unsafe {
199
197
match self . unpack ( ) {
200
198
Inline ( ..) => {
201
- let buf = repr :: inline_orig_bytes ( & self . data ) ;
199
+ let buf = string_cache_shared :: inline_orig_bytes ( & self . data ) ;
202
200
str:: from_utf8 ( buf) . unwrap ( )
203
201
} ,
204
202
Static ( idx) => * static_atom_set. index ( idx as usize ) . expect ( "bad static atom" ) ,
@@ -215,7 +213,7 @@ impl Clone for Atom {
215
213
#[ inline( always) ]
216
214
fn clone ( & self ) -> Atom {
217
215
unsafe {
218
- match repr :: from_packed_dynamic ( self . data ) {
216
+ match string_cache_shared :: from_packed_dynamic ( self . data ) {
219
217
Some ( entry) => {
220
218
let entry = entry as * mut StringCacheEntry ;
221
219
( * entry) . ref_count . fetch_add ( 1 , SeqCst ) ;
@@ -238,7 +236,7 @@ impl Drop for Atom {
238
236
}
239
237
240
238
unsafe {
241
- match repr :: from_packed_dynamic ( self . data ) {
239
+ match string_cache_shared :: from_packed_dynamic ( self . data ) {
242
240
// We use #[unsafe_no_drop_flag] so that Atom will be only 64
243
241
// bits. That means we need to ignore a NULL pointer here,
244
242
// which represents a value that was moved out.
@@ -312,7 +310,7 @@ mod bench;
312
310
mod tests {
313
311
use std:: thread;
314
312
use super :: Atom ;
315
- use super :: repr :: { Static , Inline , Dynamic } ;
313
+ use string_cache_shared :: { Static , Inline , Dynamic } ;
316
314
317
315
#[ test]
318
316
fn test_as_slice ( ) {
0 commit comments