Fix Bytes::truncate losing the original Vec's capacity (#361)

This commit is contained in:
Sean McArthur
2020-01-22 16:37:53 -08:00
committed by Carl Lerche
parent 729bc7c208
commit e0eebde993
3 changed files with 85 additions and 2 deletions
+1 -1
View File
@@ -41,7 +41,7 @@ unsafe impl GlobalAlloc for Odd {
};
System.dealloc(ptr.offset(-1), new_layout);
} else {
System.alloc(layout);
System.dealloc(ptr, layout);
}
}
}