php / php/php-src

Delaying destructors and GC

オープン
#20,001 コメント 10 件 リアクション 3 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

Bug Status: Needs Triage
主要言語
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:

https://github.com/php/php-src/pull/19787 delays GC runs, but not destructors.

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

zval_ptr_dtor() と VM-interrupt/safepoint の議論から始め、次に GC の実行は遅延させるがデストラクタは遅延させない pull request 19787 と比較してください。完了とするには、定義された safepoint ポリシーと、issue に列挙された集約されたケースに対処する完全な実装が必要です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
c, php
領域
compilers
issue の種類
機能追加
難易度
5/5
見積もり時間
1週間以上
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
20/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。