Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
f9314af
Allow all entries to be soft_expired
Sep 12, 2023
7bd94a7
Small SMA code cleanups / improvements
madmajestro May 26, 2025
289addf
Refactor linked lists of the cache layer to doubly linked lists
madmajestro May 14, 2025
d0a1fa9
Add defragmentation to apcu
madmajestro May 23, 2025
19eb5cf
Add support for hugetlb pages on Linux (#559)
KitanoTom Jun 3, 2025
4292854
Disable Windows CI for PHP 7.x (#565)
nikic Jun 3, 2025
01e5c4d
Fix Linux CI for PHP 7.x to not silently abort tests (#567)
madmajestro Jun 6, 2025
ebd7a02
Update atime and statistics when accessing entries with apcu_exists()…
madmajestro Jun 8, 2025
955031e
Update changelog
nikic Jun 8, 2025
51b745d
Update changelog (#569)
madmajestro Jun 9, 2025
66150a1
Add cache cleanup and defragmentation counts to apcu_cache_info() (#570)
madmajestro Jun 14, 2025
322dcea
Update TECHNOTES (#574)
madmajestro Jul 12, 2025
3bab43a
Fix relocatable representation of zend_empty_array (#575)
madmajestro Jul 12, 2025
8e7ed9a
Add test that a repeated unpersist doesn't break representation (#577)
madmajestro Jul 26, 2025
16b021c
Add reference and empty array to the defrag test (#576)
madmajestro Jul 27, 2025
616c72d
Release apcu 5.1.25
nikic Jul 28, 2025
e63ac23
Back to dev
nikic Jul 28, 2025
1ca8ca9
Use different fatal error in test for PHP 8.5
madmajestro Jul 29, 2025
459e208
Add PHP 8.5 to Linux CI matrix
madmajestro Jul 29, 2025
6b23303
Fix stacking of default expunge operations
madmajestro Aug 4, 2025
66b4f12
Fix race condition during allocation / defragmentation (#584)
madmajestro Aug 5, 2025
43719b8
Release apcu 5.1.26
nikic Aug 5, 2025
3625ba4
Back to dev
nikic Aug 5, 2025
3c53e4c
Cleanup code comments (#585)
madmajestro Aug 13, 2025
fe599cd
Fix releasing of ref_count in apc_cache_store() (#587)
madmajestro Aug 14, 2025
25cd3bc
Remove report_memleaks ini directive from tests (#590)
madmajestro Aug 20, 2025
36e51f0
Release apcu 5.1.27
madmajestro Aug 28, 2025
3245a25
Back to dev
madmajestro Aug 28, 2025
023c16b
Reclaim unused space from allocated blocks during defragmentation
madmajestro Aug 19, 2025
a6b94a5
Remove test bug63224.phpt
madmajestro Sep 21, 2025
d17bf0b
Removed obsolete files from the test directory
madmajestro Sep 24, 2025
c48075c
Add PHP 8.5 to Windows CI
madmajestro Sep 26, 2025
efcaa35
Improve SMA allocation performance and lock contention
madmajestro Oct 10, 2025
6846950
Small SMA code improvements
madmajestro Oct 10, 2025
9eb62d1
Check result of SMA lock acquisitions
madmajestro Oct 17, 2025
d720b62
Prevent PHP warnings when using apc.php with APCu versions <= 5.1.24
madmajestro Oct 21, 2025
7d1c95b
The zval_dtor() alias of zval_ptr_dtor_nogc() has been removed
k0d3r1s Dec 4, 2025
352caaf
Prevent cache wipes caused by huge allocation attempts
madmajestro Dec 7, 2025
819fce9
Release apcu 5.1.28
nikic Dec 7, 2025
6bd11cb
chore(PLATFORM-11898): bump apcu
albertsko Aug 26, 2026
ca7e208
chore(PLATFORM-11898): cover soft expiry of entries with per-entry TTL
albertsko Aug 26, 2026
cdd4db7
Merge pull request #2 from Wikia/PLATFORM-11898-apcu
peterdevpl Aug 27, 2026
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
24 changes: 8 additions & 16 deletions .github/workflows/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ jobs:
ubuntu:
strategy:
matrix:
version: ["7.0", "7.1", "7.2", "7.3", "7.4", "8.0", "8.1", "8.2", "8.3", "8.4"]
version: ["7.0", "7.1", "7.2", "7.3", "7.4", "8.0", "8.1", "8.2", "8.3", "8.4", "8.5"]
runs-on: ubuntu-latest
steps:
- name: Set the hugepages parameter
run: sudo sh -c "echo 1 > /proc/sys/vm/nr_hugepages"
- name: Checkout apcu
uses: actions/checkout@v4
- name: Setup PHP
Expand All @@ -17,6 +19,8 @@ jobs:
run: phpize
- name: configure
run: ./configure --enable-apcu-debug
- name: Fix missing PHP_EXECUTABLE in Makefile for PHP 7.x
run: sed -i -e 's/^PHP_EXECUTABLE = NONE$/PHP_EXECUTABLE = \/usr\/bin\/php/' Makefile
- name: make
run: make
- name: test
Expand All @@ -31,28 +35,16 @@ jobs:
shell: cmd
strategy:
matrix:
version: ["7.0", "7.1", "7.2", "7.3", "7.4", "8.0", "8.1", "8.2", "8.3", "8.4"]
version: ["8.0", "8.1", "8.2", "8.3", "8.4", "8.5"]
arch: [x64]
ts: [nts, ts]
os: [windows-2019, windows-2022]
exclude:
- { os: windows-2019, version: "8.4" }
- { os: windows-2019, version: "8.3" }
- { os: windows-2019, version: "8.2" }
- { os: windows-2019, version: "8.1" }
- { os: windows-2019, version: "8.0" }
- { os: windows-2022, version: "7.4" }
- { os: windows-2022, version: "7.3" }
- { os: windows-2022, version: "7.2" }
- { os: windows-2022, version: "7.1" }
- { os: windows-2022, version: "7.0" }
runs-on: ${{matrix.os}}
runs-on: windows-2022
steps:
- name: Checkout apcu
uses: actions/checkout@v4
- name: Setup PHP
id: setup-php
uses: php/setup-php-sdk@v0.10
uses: php/setup-php-sdk@v0.11
with:
version: ${{matrix.version}}
arch: ${{matrix.arch}}
Expand Down
423 changes: 162 additions & 261 deletions TECHNOTES.txt

Large diffs are not rendered by default.

15 changes: 4 additions & 11 deletions apc.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
#include "apc_globals.h"
#include "php.h"

/* {{{ console display functions */
/* console display functions */
#define APC_PRINT_FUNCTION(name, verbosity) \
void apc_##name(const char *format, ...) \
{ \
Expand All @@ -54,9 +54,7 @@ APC_PRINT_FUNCTION(debug, E_NOTICE)
#else
void apc_debug(const char *format, ...) {}
#endif
/* }}} */

/* {{{ apc_flip_hash */
HashTable* apc_flip_hash(HashTable *hash) {
zval data, *entry;
HashTable *new_hash;
Expand All @@ -79,7 +77,6 @@ HashTable* apc_flip_hash(HashTable *hash) {

return new_hash;
}
/* }}} */

/*
* Serializer API
Expand All @@ -88,9 +85,7 @@ HashTable* apc_flip_hash(HashTable *hash) {

/* pointer to the list of serializers */
static apc_serializer_t apc_serializers[APC_MAX_SERIALIZERS] = {{0,}};
/* }}} */

/* {{{ apc_register_serializer */
PHP_APCU_API int _apc_register_serializer(
const char* name, apc_serialize_t serialize, apc_unserialize_t unserialize, void *config) {
int i;
Expand All @@ -112,14 +107,12 @@ PHP_APCU_API int _apc_register_serializer(
}

return 0;
} /* }}} */
}

/* {{{ apc_get_serializers */
PHP_APCU_API apc_serializer_t* apc_get_serializers() {
return &(apc_serializers[0]);
} /* }}} */
}

/* {{{ apc_find_serializer */
PHP_APCU_API apc_serializer_t* apc_find_serializer(const char* name) {
int i;
apc_serializer_t *serializer;
Expand All @@ -131,7 +124,7 @@ PHP_APCU_API apc_serializer_t* apc_find_serializer(const char* name) {
}
}
return NULL;
} /* }}} */
}

/*
* Local variables:
Expand Down
20 changes: 7 additions & 13 deletions apc.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,32 +107,26 @@ PHP_APCU_API HashTable* apc_flip_hash(HashTable *hash);
typedef int (*apc_serialize_t)(APC_SERIALIZER_ARGS);
typedef int (*apc_unserialize_t)(APC_UNSERIALIZER_ARGS);

/* {{{ struct definition: apc_serializer_t */
typedef struct apc_serializer_t {
const char* name;
apc_serialize_t serialize;
apc_unserialize_t unserialize;
void* config;
} apc_serializer_t;
/* }}} */

/* {{{ _apc_register_serializer
registers the serializer using the given name and parameters */
/* registers the serializer using the given name and parameters */
PHP_APCU_API int _apc_register_serializer(
const char* name, apc_serialize_t serialize, apc_unserialize_t unserialize, void *config);
/* }}} */

/* {{{ apc_get_serializers
fetches the list of serializers */
PHP_APCU_API apc_serializer_t* apc_get_serializers(void); /* }}} */
/* fetches the list of serializers */
PHP_APCU_API apc_serializer_t* apc_get_serializers(void);

/* {{{ apc_find_serializer
finds a previously registered serializer by name */
PHP_APCU_API apc_serializer_t* apc_find_serializer(const char* name); /* }}} */
/* finds a previously registered serializer by name */
PHP_APCU_API apc_serializer_t* apc_find_serializer(const char* name);

/* {{{ default serializers */
/* default serializers */
PHP_APCU_API int APC_SERIALIZER_NAME(php) (APC_SERIALIZER_ARGS);
PHP_APCU_API int APC_UNSERIALIZER_NAME(php) (APC_UNSERIALIZER_ARGS); /* }}} */
PHP_APCU_API int APC_UNSERIALIZER_NAME(php) (APC_UNSERIALIZER_ARGS);

#define php_apc_try \
{ \
Expand Down
4 changes: 4 additions & 0 deletions apc.php
Original file line number Diff line number Diff line change
Expand Up @@ -766,6 +766,8 @@ function block_sort($array1, $array2)
$insert_rate_user = sprintf("%.2f", $cache['num_inserts'] ? (($cache['num_inserts'])/$elapsed) : 0);
$apcversion = phpversion('apcu');
$phpversion = phpversion();
$cleanups = $cache['cleanups'] ?? '-';
$defragmentations = $cache['defragmentations'] ?? '-';
$number_vars = $cache['num_entries'];
$size_vars = bsize($cache['mem_size']);
$num_hits_and_misses = $cache['num_hits'] + $cache['num_misses'];
Expand Down Expand Up @@ -804,6 +806,8 @@ function block_sort($array1, $array2)
<tr class=tr-0><td class=td-0>Hit Rate</td><td>$hit_rate_user cache requests/second</td></tr>
<tr class=tr-1><td class=td-0>Miss Rate</td><td>$miss_rate_user cache requests/second</td></tr>
<tr class=tr-0><td class=td-0>Insert Rate</td><td>$insert_rate_user cache requests/second</td></tr>
<tr class=tr-1><td class=td-0>Cache cleanup count</td><td>$cleanups</td></tr>
<tr class=tr-0><td class=td-0>Cache defragmentation count</td><td>$defragmentations</td></tr>
<tr class=tr-1><td class=td-0>Cache full count</td><td>{$cache['expunges']}</td></tr>
</tbody>
</table>
Expand Down
Loading
Loading