remove code as per feedback
This commit is contained in:
@@ -572,7 +572,6 @@ pub unsafe extern "C" fn gethostname(mut name: *mut c_char, mut len: size_t) ->
|
||||
.map(|()| 0)
|
||||
.or_minus_one_errno();
|
||||
if err < 0 {
|
||||
mem::forget(uts); // forget does nothing with Copy types
|
||||
return err;
|
||||
}
|
||||
for c in unsafe { uts.assume_init() }.nodename.iter() {
|
||||
|
||||
@@ -75,14 +75,12 @@ unsafe impl GlobalAlloc for Allocator {
|
||||
let new =
|
||||
unsafe { self.alloc(Layout::from_size_align_unchecked(new_size, layout.align())) };
|
||||
let old_size = layout.size();
|
||||
let old_align = layout.align();
|
||||
|
||||
if !new.is_null() {
|
||||
let size = cmp::min(old_size, new_size);
|
||||
unsafe { copy_nonoverlapping(ptr, new, size) };
|
||||
}
|
||||
|
||||
drop((old_size, old_align)); // drop does nothing with Copy types
|
||||
unsafe { (*self.get()).lock().free(ptr) };
|
||||
|
||||
new
|
||||
|
||||
Reference in New Issue
Block a user