diff options
| author | Felix S. Klock II <pnkfelix@pnkfx.org> | 2015-02-10 10:04:39 +0100 |
|---|---|---|
| committer | Felix S. Klock II <pnkfelix@pnkfx.org> | 2015-03-26 14:08:54 +0100 |
| commit | 3902190ac4d64962b2c1ac9a6ae88777b7112f82 (patch) | |
| tree | 61759f62fbca6a1e9c25e3e95dd1d957340510df /src/libstd | |
| parent | 1501f33e76f6f9621aa08fb0cbbc5f85a5ac7f0f (diff) | |
Switch drop-flag to `u8` to allow special tags to instrument state.
Refactored code so that the drop-flag values for initialized (`DTOR_NEEDED`) versus dropped (`DTOR_DONE`) are given explicit names. Add `mem::dropped()` (which with `DTOR_DONE == 0` is semantically the same as `mem::zeroed`, but the point is that it abstracts away from the particular choice of value for `DTOR_DONE`). Filling-drop needs to use something other than `ptr::read_and_zero`, so I added such a function: `ptr::read_and_drop`. But, libraries should not use it if they can otherwise avoid it. Fixes to tests to accommodate filling-drop.
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/collections/hash/table.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libstd/collections/hash/table.rs b/src/libstd/collections/hash/table.rs index 052bcfd7e16..710f0fe19db 100644 --- a/src/libstd/collections/hash/table.rs +++ b/src/libstd/collections/hash/table.rs @@ -985,7 +985,7 @@ impl<K: Clone, V: Clone> Clone for RawTable<K, V> { #[unsafe_destructor] impl<K, V> Drop for RawTable<K, V> { fn drop(&mut self) { - if self.capacity == 0 { + if self.capacity == 0 || self.capacity == mem::POST_DROP_USIZE { return; } |
