Delaying destructors and GC
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- C
- Star
- 40.4k
- Fork
- 8.1k
- Merge trung bình
- 2 ngày 13 giờ
- Pull request đã merge (30 ngày)
- 96
Mô tả
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.
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Bắt đầu với zval_ptr_dtor() và phần thảo luận về VM-interrupt/safepoint, sau đó so sánh pull request 19787, vốn trì hoãn các lần chạy GC nhưng không trì hoãn các destructor. Để được xem là hoàn tất, cần có một chính sách safepoint được xác định và một triển khai đầy đủ xử lý các trường hợp tổng hợp được liệt kê trong issue.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- c, php
- Lĩnh vực
- compilers
- Loại issue
- Tính năng
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Cần làm rõ
- Mức phù hợp với người mới
- 20/100