Repository navigation
Commit 6b0d0ba
Patrick Quist
Remove an attribute by dropping its entry
SetAttribute with an empty value goes through RemoveAttribute, which did not
remove anything. It computed the byte offset of the entry past the one being
removed and then moved the entries one slot further along rather than back,
so the removed entry stayed, the one before the last was overwritten, and the
array kept its length. Only the key's bit in FAttributesInUse was cleared,
which hid the stale entry from HasAttribute but not from Attributes, so the
writers and the binary serializer still saw it. The Move also copied the
string values bit for bit, leaving two entries owning one reference.
RemoveAttribute now shifts the entries after the removed one back by
assignment, which keeps the string reference counts right, and shortens the
array by one.1 parent 6964589 commit 6b0d0ba
2 files changed
Lines changed: 37 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
438 | 438 | | |
439 | 439 | | |
440 | 440 | | |
441 | | - | |
442 | | - | |
443 | 441 | | |
444 | | - | |
445 | | - | |
446 | | - | |
447 | | - | |
448 | | - | |
449 | | - | |
450 | | - | |
451 | | - | |
452 | | - | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
453 | 456 | | |
454 | 457 | | |
455 | 458 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
258 | 258 | | |
259 | 259 | | |
260 | 260 | | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
261 | 283 | | |
262 | 284 | | |
263 | 285 | | |
| |||
333 | 355 | | |
334 | 356 | | |
335 | 357 | | |
| 358 | + | |
336 | 359 | | |
337 | 360 | | |
338 | 361 | | |
| |||
0 commit comments