Commit 616cdef
fix(core): don't coerce all producers to consumers on liveness change (#56140)
When a consumer switches its liveness state, it gets added to / removed from
the consumer list of all of its producers. This operation is transitive, so
if its producer is *also* a consumer and *its* liveness state is switched,
then the change is applied recursively.
Note that this only matters *if* the producer is also a consumer. However,
the logic in `producerAddLiveConsumer` / `producerRemoveLiveConsumerAtIndex`
coerced the producer node into a producer & consumer node, which allocated
extra arrays into the node structure that are never used. This didn't affect
correctness, but increased the memory usage of plain signal nodes (which are
just producers, never consumers).
This fix changes the logic in those operations to simply check if a producer
is also a consumer instead of coercing it into one.
PR Close #561401 parent 7659dff commit 616cdef
1 file changed
+6
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
439 | 439 | | |
440 | 440 | | |
441 | 441 | | |
442 | | - | |
443 | | - | |
| 442 | + | |
444 | 443 | | |
445 | 444 | | |
446 | 445 | | |
| |||
455 | 454 | | |
456 | 455 | | |
457 | 456 | | |
458 | | - | |
459 | 457 | | |
460 | 458 | | |
461 | 459 | | |
462 | 460 | | |
463 | 461 | | |
464 | 462 | | |
465 | 463 | | |
466 | | - | |
| 464 | + | |
467 | 465 | | |
468 | 466 | | |
469 | 467 | | |
| |||
506 | 504 | | |
507 | 505 | | |
508 | 506 | | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
0 commit comments