Skip to content
Permalink
Browse files
Direct port -> idiomatic Rust
  • Loading branch information
steveklabnik committed Sep 3, 2016
1 parent daadce1 commit eda13bf83a313650b6a992d34c585030842e0830
Showing 1 changed file with 4 additions and 5 deletions.
@@ -10,12 +10,11 @@ pub type Value = libc::uintptr_t;
static Qnil: libc::uintptr_t = 0x08 as libc::uintptr_t;

#[no_mangle]
pub unsafe extern fn rb_mem_clear(mut mem: *mut Value, mut size: libc::c_long) {
while size != 0 {
size -= 1;
*mem = Qnil;
pub unsafe extern fn rb_mem_clear(mem: *mut Value, size: libc::c_long) {
for i in 0..size {
let mem = mem.offset(i as isize);

mem = mem.offset(1);
*mem = Qnil;
}
}

0 comments on commit eda13bf

Please sign in to comment.