소스 검색

fix the build (#42)

* fix the build

the `unborrow!` macro is need in the block and bookkeeper modules

* cfg(tls) away impl LocalAllocator

as the struct LocalAllocator is not available when the tls feature is
disabled
Jorge Aparicio 8 년 전
부모
커밋
1dad80a901
3개의 변경된 파일4개의 추가작업 그리고 2개의 파일을 삭제
  1. 1 0
      src/allocator.rs
  2. 3 1
      src/lib.rs
  3. 0 1
      src/unborrow.rs

+ 1 - 0
src/allocator.rs

@@ -203,6 +203,7 @@ pub struct LocalAllocator {
     inner: Bookkeeper,
 }
 
+#[cfg(feature = "tls")]
 impl LocalAllocator {
     /// Initialize the local allocator.
     #[cfg(feature = "tls")]

+ 3 - 1
src/lib.rs

@@ -33,6 +33,9 @@ mod tls;
 #[cfg(feature = "allocator")]
 mod symbols;
 
+#[macro_use]
+mod unborrow;
+
 mod allocator;
 mod block;
 mod bookkeeper;
@@ -44,7 +47,6 @@ mod leak;
 mod prelude;
 mod ptr;
 mod sync;
-mod unborrow;
 mod vec;
 
 pub use allocator::{alloc, free, realloc, realloc_inplace};

+ 0 - 1
src/unborrow.rs

@@ -37,7 +37,6 @@
 ///
 /// # }
 /// ```
-#[macro_export]
 macro_rules! unborrow {
     // =========================================================================================================
     // PRIVATE RULES