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

Remove unused function apc_cache_find() #538

Merged
merged 1 commit into from
Mar 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions TECHNOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -233,9 +233,8 @@ form of a quick-start guide to start hacking on APCu.
deletion occurs depends on runtime parameters, see INSTALL for runtime parameter
configuration details.

apc_cache_find() simply hashes and returns the entry if it is there. If it is there
but older than the mtime in the entry we are looking for, we delete the one that is
there and return indicating we didn't find it.
apc_cache_rlocked_find() simply hashes and returns the entry if it is there. If it is there
but older than the mtime in the entry we are looking for, we return indicating we didn't find it.

API users are advised to use apc_cache_fetch over find for simplicity, this ensures
correct operation, fetch sets up the call to find and takes care of copying and releasing
Expand Down
20 changes: 0 additions & 20 deletions apc_cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -784,26 +784,6 @@ PHP_APCU_API void apc_cache_default_expunge(apc_cache_t* cache, size_t size)
}
/* }}} */

/* {{{ apc_cache_find */
PHP_APCU_API apc_cache_entry_t *apc_cache_find(apc_cache_t* cache, zend_string *key, time_t t)
{
apc_cache_entry_t *entry;

if (!cache) {
return NULL;
}

if (!apc_cache_rlock(cache)) {
return NULL;
}

entry = apc_cache_rlocked_find_incref(cache, key, t);
apc_cache_runlock(cache);

return entry;
}
/* }}} */

/* {{{ apc_cache_fetch */
PHP_APCU_API zend_bool apc_cache_fetch(apc_cache_t* cache, zend_string *key, time_t t, zval *dst)
{
Expand Down
9 changes: 1 addition & 8 deletions apc_cache.h
Original file line number Diff line number Diff line change
Expand Up @@ -167,13 +167,6 @@ PHP_APCU_API zend_bool apc_cache_atomic_update_long(
apc_cache_t *cache, zend_string *key, apc_cache_atomic_updater_t updater, void *data,
zend_bool insert_if_not_found, zend_long ttl);

/*
* apc_cache_find searches for a cache entry by its hashed identifier,
* and returns a pointer to the entry if found, NULL otherwise.
*
*/
PHP_APCU_API apc_cache_entry_t* apc_cache_find(apc_cache_t* cache, zend_string *key, time_t t);

/*
* apc_cache_fetch fetches an entry from the cache directly into dst
*
Expand All @@ -198,7 +191,7 @@ PHP_APCU_API zend_bool apc_cache_entry_fetch_zval(

/*
* apc_cache_entry_release decrements the reference count associated with a cache
* entry. Calling apc_cache_find automatically increments the reference count,
* entry. Calling apc_cache_rlocked_find_incref automatically increments the reference count,
* and this function must be called post-execution to return the count to its
* original value. Failing to do so will prevent the entry from being
* garbage-collected.
Expand Down