Delaying destructors and GC
まだ誰も着手していません。
- 主要言語
- C
- スター
- 40.4k
- フォーク
- 8.1k
- 平均マージ
- 2日 13時間
- マージ済み PR(30日)
- 96
説明
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.
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
zval_ptr_dtor() と VM-interrupt/safepoint の議論から始め、次に GC の実行は遅延させるがデストラクタは遅延させない pull request 19787 と比較してください。完了とするには、定義された safepoint ポリシーと、issue に列挙された集約されたケースに対処する完全な実装が必要です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- c, php
- 領域
- compilers
- issue の種類
- 機能追加
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 活発さ
- 停滞
- 明瞭さ
- 説明が足りない
- 初心者へのやさしさ
- 20/100