Commit 9d13ff8
committed
[ADT] Make DenseMapBase::moveFrom safer (NFC)
Without this patch, DenseMapBase::moveFrom() moves buckets and leaves
the moved-from object in a zombie state. This patch teaches
moveFrom() to call kill() so that the move-from object is in a known
good state. This brings moveFrom()'s behavior in line with standard
C++ move semantics.
kill() is implemented so that it takes the fast path in the destructor
-- both destroyAll() and deallocateBuckets().1 parent 29e3c2e commit 9d13ff8
1 file changed
+23
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
441 | 441 | | |
442 | 442 | | |
443 | 443 | | |
444 | | - | |
445 | | - | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
446 | 450 | | |
447 | 451 | | |
448 | 452 | | |
| |||
830 | 834 | | |
831 | 835 | | |
832 | 836 | | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
833 | 844 | | |
834 | 845 | | |
835 | 846 | | |
| |||
1107 | 1118 | | |
1108 | 1119 | | |
1109 | 1120 | | |
| 1121 | + | |
| 1122 | + | |
| 1123 | + | |
| 1124 | + | |
| 1125 | + | |
| 1126 | + | |
| 1127 | + | |
1110 | 1128 | | |
1111 | 1129 | | |
1112 | 1130 | | |
| |||
1117 | 1135 | | |
1118 | 1136 | | |
1119 | 1137 | | |
| 1138 | + | |
1120 | 1139 | | |
1121 | 1140 | | |
1122 | | - | |
1123 | | - | |
1124 | 1141 | | |
1125 | | - | |
1126 | 1142 | | |
1127 | | - | |
| 1143 | + | |
| 1144 | + | |
1128 | 1145 | | |
1129 | 1146 | | |
1130 | 1147 | | |
| |||
0 commit comments