Re: Don't add simple objects to GC's roots

From: Date: Thu, 27 Jul 2017 16:14:29 +0000
Subject: Re: Don't add simple objects to GC's roots
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-100064@lists.php.net to get a copy of this message
On 26 Jul 2017, at 22:57, 吕海涛 <0@lvht.net> wrote:>> There is a way to work around: just call gc_disable(). But this means >> dealing with side effects of the engine in userland. Moreover, this also >> means leaking memory, since meanwhile roots are not populated. >Maybe we could make gc_disable accept one reference zval as parameter, and >clear the GC_COLLECTABLE flag of zval.value->gc.u.v.flags. So, this zval >will never be put into gc root list. I don't think it's a good idea to expose such an internal detail to userland. The more we expose, the more limits we will face in the future if we want to make some changes. best regards, CHU Zhaowei

« previous php.internals (#100064) next »