lib.rs 615 B

1234567891011121314151617181920
  1. // Copyright (c) 2016-2018, The Tor Project, Inc. */
  2. // See LICENSE for licensing information */
  3. //! Allocation helper functions that allow data to be allocated in Rust
  4. //! using tor's specified allocator. In doing so, this can be later freed
  5. //! from C.
  6. //!
  7. //! This is currently a temporary solution, we will later use tor's allocator
  8. //! by default for any allocation that occurs in Rust. However, as this will
  9. //! stabalize in 2018, we can use this as a temporary measure.
  10. extern crate libc;
  11. use std::alloc::System;
  12. mod tor_allocate;
  13. pub use tor_allocate::*;
  14. #[global_allocator]
  15. static A: System = System;