Skip to content

Small code improvements to the cache layer - #625

Merged
madmajestro merged 3 commits into
krakjoe:masterfrom
madmajestro:small-code-improvements
Jun 5, 2026
Merged

Small code improvements to the cache layer#625
madmajestro merged 3 commits into
krakjoe:masterfrom
madmajestro:small-code-improvements

Conversation

@madmajestro

Copy link
Copy Markdown
Collaborator

No description provided.

The function apc_cache_store_internal() internally calls
apc_cache_wlocked_insert(), but it doesn't acquire the required wlock.
Therefore, it has been renamed to apc_cache_wlocked_store_internal() to
indicate that a write lock has to be acquired by the caller.
The TTL is passed as zend_long to the APCu functions and stored as
zend_long within the entries. There is no reason to treat this value as
an int32_t or uint32_t at any point in between.
Since PHP 7.0, the hash of a string is stored within the zend_string
structure. This means that it is not necessary to pass the hash to a
function in addition to the zend_string itself.
@madmajestro
madmajestro merged commit 9d8fae2 into krakjoe:master Jun 5, 2026
50 checks passed
@madmajestro
madmajestro deleted the small-code-improvements branch June 5, 2026 16:54
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

Successfully merging this pull request may close these issues.

1 participant