@@ -760,40 +760,32 @@ PHP_APCU_API void apc_cache_default_expunge(apc_cache_t* cache, size_t size)
760
760
/* get available */
761
761
available = apc_sma_get_avail_mem (cache -> sma );
762
762
763
- /* perform expunge processing */
764
- if (!cache -> ttl ) {
765
- /* check it is necessary to expunge */
766
- if (available < suitable ) {
767
- apc_cache_wlocked_real_expunge (cache );
768
- }
769
- } else {
770
- /* check that expunge is necessary */
771
- if (available < suitable ) {
772
- size_t i ;
773
-
774
- /* look for junk */
775
- for (i = 0 ; i < cache -> nslots ; i ++ ) {
776
- apc_cache_entry_t * * entry = & cache -> slots [i ];
777
- while (* entry ) {
778
- if (apc_cache_entry_expired (cache , * entry , t )) {
779
- apc_cache_wlocked_remove_entry (cache , entry );
780
- continue ;
781
- }
782
-
783
- /* grab next entry */
784
- entry = & (* entry )-> next ;
763
+ /* check that expunge is necessary */
764
+ if (available < suitable ) {
765
+ size_t i ;
766
+
767
+ /* look for junk */
768
+ for (i = 0 ; i < cache -> nslots ; i ++ ) {
769
+ apc_cache_entry_t * * entry = & cache -> slots [i ];
770
+ while (* entry ) {
771
+ if (apc_cache_entry_expired (cache , * entry , t )) {
772
+ apc_cache_wlocked_remove_entry (cache , entry );
773
+ continue ;
785
774
}
786
- }
787
775
788
- /* if the cache now has space, then reset last key */
789
- if (apc_sma_get_avail_size (cache -> sma , size )) {
790
- /* wipe lastkey */
791
- memset (& cache -> header -> lastkey , 0 , sizeof (apc_cache_slam_key_t ));
792
- } else {
793
- /* with not enough space left in cache, we are forced to expunge */
794
- apc_cache_wlocked_real_expunge (cache );
776
+ /* grab next entry */
777
+ entry = & (* entry )-> next ;
795
778
}
796
779
}
780
+
781
+ /* if the cache now has space, then reset last key */
782
+ if (apc_sma_get_avail_size (cache -> sma , size )) {
783
+ /* wipe lastkey */
784
+ memset (& cache -> header -> lastkey , 0 , sizeof (apc_cache_slam_key_t ));
785
+ } else {
786
+ /* with not enough space left in cache, we are forced to expunge */
787
+ apc_cache_wlocked_real_expunge (cache );
788
+ }
797
789
}
798
790
799
791
apc_cache_wunlock (cache );
0 commit comments