manual2.rs 300 B

123456789101112131415
  1. extern crate ralloc;
  2. #[global_allocator]
  3. static ALLOCATOR: ralloc::Allocator = ralloc::Allocator;
  4. mod util;
  5. #[test]
  6. fn manual2() {
  7. let ptr = ralloc::alloc(1723, 8);
  8. assert!(!ptr.is_null());
  9. for offset in 0..1723 {
  10. unsafe { *(ptr as *mut u8).offset(offset) = 0 as u8 };
  11. }
  12. }