Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Conforming implementations are not required to use ref counting" -- statement correct? #212

Open
sidkshatriya opened this issue Sep 26, 2017 · 0 comments

Comments

@sidkshatriya
Copy link

sidkshatriya commented Sep 26, 2017

In:

https://github.com/php/php-langspec/blob/master/spec/04-basic-concepts.md#reclamation-and-automatic-memory-management

Despite the use of the term refcount, conforming implementations are not required to use a reference counting-based implementation for automatic memory management.

Is this statement correct? If I understand correctly many PHP projects depend on the deterministic firing of __destruct() function to cleanup SQL transactions or connections.

HHVM elaborates on this:

Eliminating destructors. Deterministic object destruction is the reason why nonscalar PHP values require precise reference counting. This requirement has long been, and continues to be, a sizable performance bottleneck in our optimized JIT-compiled code. Using garbage collection instead could unlock measurable performance improvements, and the behavior of destructors could be closely imitated by a combination of try/finally and other new language constructs.

(from http://hhvm.com/blog/2017/09/18/the-future-of-hhvm.html )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant