Delaying destructors and GC
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- C
- Sterne
- 40.4k
- Forks
- 8.1k
- Ø Merge
- 2 T. 13 Std.
- Gemergte PRs (30 T.)
- 96
Beschreibung
Description
Due to destructors and the cycle collector, zval_ptr_dtor() may have more effects than just freeing the given zval. This is the cause of bugs and workarounds.
These bugs and workarounds could be avoided by delaying destructors and GC runs until a safepoint is reached. If we use vm interrupts as safepoints, this would delay destructors until the next branch/loop or function call (this should be defined more precisely), which seems reasonable.
I'm creating this ticket to aggregate issues that would not exist with delayed destructors and GC runs:
- 3d2b1753393b
- 6f38acfaf906
- https://bugs.php.net/bug.php?id=71020
- https://bugs.php.net/bug.php?id=73423
- https://github.com/php/php-src/issues/10168
- https://github.com/php/php-src/issues/13612
- https://github.com/php/php-src/issues/16464
- https://github.com/php/php-src/issues/16478
- https://github.com/php/php-src/issues/16479
- https://github.com/php/php-src/issues/16646
- https://github.com/php/php-src/issues/17162
- https://github.com/php/php-src/issues/18209
- https://github.com/php/php-src/issues/19999
- https://github.com/php/php-src/issues/20405
- https://github.com/php/php-src/issues/20477
- https://github.com/php/php-src/issues/20657
- https://github.com/php/php-src/issues/21824
- https://github.com/php/php-src/issues/22061
- https://github.com/php/php-src/issues/22062
https://github.com/php/php-src/pull/19787 delays GC runs, but not destructors.
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginnen Sie mit zval_ptr_dtor() und der Diskussion über VM-interrupt/safepoint, und vergleichen Sie dann pull request 19787, die GC-Läufe, aber nicht Destruktoren verzögert. Die Aufgabe wäre erst erledigt, wenn eine definierte Safepoint-Policy und eine vollständige Implementierung vorhanden sind, die die im Issue aufgeführten aggregierten Fälle behandelt.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- c, php
- Bereich
- compilers
- Issue-Typ
- Feature
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Aktivitätsstatus
- Veraltet
- Klarheit
- Muss geklärt werden
- Anfängerfreundlichkeit
- 20/100