- Notifications
You must be signed in to change notification settings - Fork3.1k
Commit8f785ec
committed
Show that@nullout works as intended
Needs a restarr to work!The forwarder / alias `IterableOnceOps./:` uses `@nullOut` to clearthe `this` reference before calling `foldLeft`. The annotation isalso on the method itself to ensure mixin forwarders (generated inthe subclass) and the static mixin accessor (generated in the trait)null out the receiver before invoking `/:`.After removing `LazyList.foldLeft`, it inherits the implementationfrom LinearSeqOps. That method again uses `@nullOut` twice, onceto clear `this` when it's no longer needed, and once on the methodfor the generated accessors.I think we should *not* use `@nullOut` everywhere in the standardlibrary, only on methods that cannot be overridden in LazyList, like`/:`.`@nullOut` works correctly on `mkString` too, but unfortunately the`addString` override in LazyList prevents GC of processed elementsdue to cycle detection.1 parent7be76ae commit8f785ec
File tree
4 files changed
+14
-22
lines changed- src/library/scala/collection
- immutable
- test/junit/scala/collection/immutable
4 files changed
+14
-22
lines changedLines changed: 10 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
755 | 755 |
| |
756 | 756 |
| |
757 | 757 |
| |
758 |
| - | |
| 758 | + | |
| 759 | + | |
759 | 760 |
| |
760 | 761 |
| |
761 | 762 |
| |
| |||
1313 | 1314 |
| |
1314 | 1315 |
| |
1315 | 1316 |
| |
| 1317 | + | |
1316 | 1318 |
| |
1317 | 1319 |
| |
1318 |
| - | |
| 1320 | + | |
1319 | 1321 |
| |
1320 | 1322 |
| |
1321 | 1323 |
| |
| |||
1328 | 1330 |
| |
1329 | 1331 |
| |
1330 | 1332 |
| |
1331 |
| - | |
| 1333 | + | |
| 1334 | + | |
1332 | 1335 |
| |
1333 | 1336 |
| |
1334 | 1337 |
| |
| |||
1339 | 1342 |
| |
1340 | 1343 |
| |
1341 | 1344 |
| |
1342 |
| - | |
| 1345 | + | |
| 1346 | + | |
1343 | 1347 |
| |
1344 | 1348 |
| |
1345 | 1349 |
| |
| |||
1365 | 1369 |
| |
1366 | 1370 |
| |
1367 | 1371 |
| |
| 1372 | + | |
1368 | 1373 |
| |
1369 | 1374 |
| |
1370 | 1375 |
| |
1371 |
| - | |
| 1376 | + | |
1372 | 1377 |
| |
1373 | 1378 |
| |
1374 | 1379 |
| |
|
Lines changed: 2 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
176 | 176 |
| |
177 | 177 |
| |
178 | 178 |
| |
| 179 | + | |
179 | 180 |
| |
180 | 181 |
| |
181 |
| - | |
| 182 | + | |
182 | 183 |
| |
183 | 184 |
| |
184 | 185 |
| |
|
Lines changed: 0 additions & 13 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
416 | 416 |
| |
417 | 417 |
| |
418 | 418 |
| |
419 |
| - | |
420 |
| - | |
421 |
| - | |
422 |
| - | |
423 |
| - | |
424 |
| - | |
425 |
| - | |
426 |
| - | |
427 |
| - | |
428 |
| - | |
429 |
| - | |
430 |
| - | |
431 |
| - | |
432 | 419 |
| |
433 | 420 |
| |
434 | 421 |
| |
|
Lines changed: 2 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
117 | 117 |
| |
118 | 118 |
| |
119 | 119 |
| |
120 |
| - | |
| 120 | + | |
121 | 121 |
| |
122 |
| - | |
123 |
| - | |
| 122 | + | |
124 | 123 |
| |
125 | 124 |
|
0 commit comments
Comments
(0)