OPCache: invalidate vs unlink

From: Date: Sun, 21 Jan 2018 10:00:47 +0000
Subject: OPCache: invalidate vs unlink
Groups: php.internals 
Request: Send a blank email to internals+get-101643@lists.php.net to get a copy of this message
zend_accel_invalidate is exposed to userland as opcache_invalidate and marks a script as wasted, however, it does not remove that script from the OPCache. There is also the zend_accel_hash_unlink that actually does that, it's there since the beginning of time but without a single call to it in the entire codebase. It actually removes a script from OPCache, yielding the desired result of freeing up some space without requiring a complete restart of OPCache. What are the reasons that this function is not used and not exposed? What side-effects does it have if we actually selectively remove scripts from OPCache? We replaced the zend_accel_invalidate call with zend_accel_hash_unlink in the opcache_invalidate implementation and it worked flawlessly. However, it could be that there are some things that we are simply overlooking. -- Richard "Fleshgrinder" Fussenegger

« previous php.internals (#101643) next »