chore(PLATFORM-11898): bump apcu - #2
Merged
Merged
Conversation
Now that setup-php-sdk has been moved to the php org and is maintained again.
PHP 8.4 changed the PHP_ZTS constant to bool: https://www.github.com/php/php-src/pull/13079 As a result, the tests that fail with ZTS would no longer be skipped.
This replaces the "hacky" Makefile variable usage in config.m4 with a regular shell variable. Issue initially noted at php/php-src#15642
- Instead of AC_ARG_ENABLE the PHP_ARG_ENABLE works in similar manner and outputs the 2nd argument as the check message. Result variable is the same (PHP_APCU_RWLOCKS). By default the option is enabled like before. The 4th argument sets whether the option is enabled, the 5th argument indicates that this is not direct extension related configuration option (build system internal handling stuff). - AC_CACHE_CHECK check refactored: Entire check moved inside the main "extension-enabled" if block, AS_VAR_IF used, redundant double Autoconf quotes reduced. - AC_MSG_FAILURE works the same as AC_MSG_ERROR except that it also outputs the "See config.log for details" message at the end in case of failure, directing the user where to check for possible failure reason.
The HAVE_SEMUN usage was removed via fcf43c9 and the check is redundant at this point.
- This uses the PHP_ARG_ENABLE instead of core AC_ARG_ENABLE to have check message automatically output and result variable PHP_APCU_SPINLOCKS set. - AS_VAR_IF used - AC_DEFINE arguments quoted and some simplistic help message text added.
- ZTS - PHP_WIN32 - HAVE_SIGACTION are either undefined or defined to 1. This fixes possible -Wundef (Windows C4668 warning code) warnings if such compiler configuration is set.
- AC_ARG_ENABLE replaced with PHP_ARG_ENABLE - checks sorted - AS_VAR_IF macros used - For checking the Valgrind header, the AC_CHECK_HEADERS is used which defines the HAVE_VALGRIND_MEMCHECK_H preprocessor macro by default - The APC_MMAP preprocessor macro is either undefined or defined to 1 so the `#if` checks are also replaced with `#ifdef` to not cause possible -Wundef warnings emitted if such compiler configuration is set
This appends the -lrt only as needed to the LIBS (if apcu is built as static) or to the APCU_SHARED_LIBADD variable (when APCu is built as shared). Modern *nix systems have shared memory operations located in default libraries and explicit linking with -lrt is redundant.
Follows-up krakjoe#449.
Since PHP 8.5, a missing trait is no longer a fatal error. Therefore, we must use a different fatal error.
Under high load, multiple parallel insert operations could trigger multiple default expunge operations at the same time. To prevent this, pending default expunge operations are now aborted if another default expunge operation has run in the meantime.
This fixes a race condition that can occur when a newly allocated entry is moved by defragmentation before it is inserted into the hash table.
The comments for a legacy code folding mechanism and other useless comments have been removed. In addition, several other comments have been improved.
In apc_cache_store(), the ref_count was decremented even when the entry needed to be deleted. This allowed the entry to be moved by defragmentation (by another process) before deletion. As a result, the pointer no longer pointed to the desired entry during deletion, causing segmentation faults.
The "report_memleaks" ini directive is deprecated in PHP 8.5 and has therefore been removed from the tests.
The fprev field now stores the used memory size for allocated blocks. This is used during defragmentation to shrink blocks if more memory has been allocated than necessary.
The test has been removed because it serves no purpose anymore, as the opcode caching functionality was removed from the project long ago. Furthermore, the magic method __sleep() is deprecated in PHP 8.5, causing this test to fail the CI pipeline starting with PHP 8.5.
These files are no longer used by any test and have therefore been deleted.
The function sma_allocate() now inserts the unused part of a split block at the beginning of the free list, instead of reinserting it at the position of the original block. This prevents large blocks from falling behind in the list when many small blocks are inserted at the beginning of the list by sma_deallocate(). Benchmarks show that this improves allocation performance and reduces the time the SMA lock must be held.
The new functions link_free_block() and unlink_free_block_at_start() are used to insert or remove blocks from the free list. This improves readability and removes duplicate code. Also, some code comments have been refined.
This should never happen, but it should still be handled properly to avoid worse.
Since the array keys "cleanups" and "defragmentations" only exist since APCu 5.1.25, PHP warnings could occur if you are using a current version of apc.php with APCu versions <= 5.1.24.
Call zval_ptr_dtor_nogc() directly instead
Trying to insert entries larger than the shared memory no longer results in the whole cache being discarded.
Author
|
The PR fails are for the |
Author
|
Important → Create a merge commit. Do NOT squash PR because of ref provided in the https://github.com/Wikia/platform-container-images/pull/303/changes. |
peterdevpl
approved these changes
Aug 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PLATFORM-11898
Changes
v5.1.28into the fork, to pick up PHP 8.4 compatibility and the 5.1.24–5.1.28 performance work (defragmentation, faster allocation, lower lock contention).apc_cache.c, so the globalapc.ttlstill soft-expires entries that carry a per-entry TTL.apc_026.phpttoapc_soft_expired.phpt, because upstream added a differentapc_026.phptin 5.1.28.apc_019.phptandapc_020.phptwith assertions of the fork's expiry behavior, so the policy is covered rather than ignored.