Improve infrastructure.

Do more encapsulation of raw pointers, use more PrimaryMaps instead of
Vecs, add a table.rs for managing table storage.
This commit is contained in:
Dan Gohman
2018-12-03 03:20:15 -08:00
parent fe1643733b
commit bd69768e0d
14 changed files with 360 additions and 253 deletions

View File

@@ -74,10 +74,9 @@ impl ScopeGuard {
impl Drop for ScopeGuard {
fn drop(&mut self) {
let orig_num_bufs = self.orig_num_bufs;
// TODO: Use `shrink_to` once it stablizes.
JMP_BUFS.with(|bufs| {
bufs.borrow_mut()
.resize(orig_num_bufs, unsafe { mem::uninitialized() })
.resize(orig_num_bufs, unsafe { mem::zeroed() })
});
}
}