Skip to content

Commit 5c243f5

Browse files
committed
Rename OPcache static cache persistent backend to pinned
1 parent 2b04041 commit 5c243f5

103 files changed

Lines changed: 1224 additions & 1224 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

ext/opcache/ZendAccelerator.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3544,7 +3544,7 @@ static zend_result accel_post_startup(void)
35443544
/* Initialize static cache if configured */
35453545
bool static_cache_configured =
35463546
ZCG(accel_directives).static_cache_volatile_size_mb != 0 ||
3547-
ZCG(accel_directives).static_cache_persistent_size_mb != 0
3547+
ZCG(accel_directives).static_cache_pinned_size_mb != 0
35483548
;
35493549
bool static_cache_preload_configured = static_cache_configured &&
35503550
ZCG(accel_directives).preload &&

ext/opcache/ZendAccelerator.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ void zend_accel_register_static_cache_handlers(const zend_opcache_static_cache_a
151151
typedef struct _zend_accel_directives {
152152
zend_long memory_consumption;
153153
zend_long static_cache_volatile_size_mb;
154-
zend_long static_cache_persistent_size_mb;
154+
zend_long static_cache_pinned_size_mb;
155155
zend_long max_accelerated_files;
156156
double max_wasted_percentage;
157157
char *user_blacklist_filename;

ext/opcache/opcache.stub.php

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ private function __construct() {}
6363
}
6464

6565
#[\Attribute(13)] /* TARGET_CLASS | TARGET_METHOD | TARGET_PROPERTY */
66-
final class PersistentStatic
66+
final class PinnedStatic
6767
{
6868
}
6969

@@ -113,33 +113,33 @@ function volatile_clear(): void {}
113113

114114
function volatile_cache_info(): StaticCacheInfo {}
115115

116-
function persistent_store(string $key, null|bool|int|float|string|array|object $value): void {}
116+
function pinned_store(string $key, null|bool|int|float|string|array|object $value): void {}
117117

118-
function persistent_store_array(array $values): void {}
118+
function pinned_store_array(array $values): void {}
119119

120-
function persistent_fetch(string $key, null|bool|int|float|string|array|object $default = null): null|bool|int|float|string|array|object {}
120+
function pinned_fetch(string $key, null|bool|int|float|string|array|object $default = null): null|bool|int|float|string|array|object {}
121121

122122
/**
123123
* @return array<string, null|bool|int|float|string|array|object>|null
124124
*/
125-
function persistent_fetch_array(array $keys, ?array $default = null): ?array {}
125+
function pinned_fetch_array(array $keys, ?array $default = null): ?array {}
126126

127-
function persistent_exists(string $key): bool {}
127+
function pinned_exists(string $key): bool {}
128128

129-
function persistent_lock(string $key, int $lease = 0): bool {}
129+
function pinned_lock(string $key, int $lease = 0): bool {}
130130

131-
function persistent_unlock(string $key): bool {}
131+
function pinned_unlock(string $key): bool {}
132132

133-
function persistent_delete(string $key_or_class): void {}
133+
function pinned_delete(string $key_or_class): void {}
134134

135-
function persistent_delete_array(array $keys): void {}
135+
function pinned_delete_array(array $keys): void {}
136136

137-
function persistent_clear(): void {}
137+
function pinned_clear(): void {}
138138

139-
function persistent_atomic_increment(string $key, int $step = 1): int {}
139+
function pinned_atomic_increment(string $key, int $step = 1): int {}
140140

141-
function persistent_atomic_decrement(string $key, int $step = 1): int {}
141+
function pinned_atomic_decrement(string $key, int $step = 1): int {}
142142

143-
function persistent_cache_info(): StaticCacheInfo {}
143+
function pinned_cache_info(): StaticCacheInfo {}
144144

145145
}

ext/opcache/opcache_arginfo.h

Lines changed: 46 additions & 46 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ext/opcache/tests/fpm/static_cache_fpm_persistent_static_class_blob_dynamic_method_statics_jit_001.phpt

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
--TEST--
2-
FPM: OPcache PersistentStatic class blob survives dynamic method statics with JIT enabled across requests
2+
FPM: OPcache PinnedStatic class blob survives dynamic method statics with JIT enabled across requests
33
--SKIPIF--
44
<?php
55
include __DIR__ . '/skipif.inc';
@@ -25,33 +25,33 @@ EOT;
2525

2626
$code = <<<'PHP'
2727
<?php
28-
function persistent_static_seed(string $logFile): int
28+
function pinned_static_seed(string $logFile): int
2929
{
3030
file_put_contents($logFile, "seed\n", FILE_APPEND);
3131
return 1;
3232
}
3333
34-
function persistent_static_jit_on(): int
34+
function pinned_static_jit_on(): int
3535
{
3636
return (int) (opcache_get_status()['jit']['on'] ?? false);
3737
}
3838
39-
#[OPcache\PersistentStatic]
39+
#[OPcache\PinnedStatic]
4040
class JitCombinedBlobState
4141
{
4242
public static int $count = 0;
4343
public static array $bag = [];
4444
4545
public static function nextValue(string $logFile): int
4646
{
47-
static $value = persistent_static_seed($logFile);
47+
static $value = pinned_static_seed($logFile);
4848
4949
return ++$value;
5050
}
5151
}
5252
5353
$request = (int) ($_GET['request'] ?? 1);
54-
$logFile = __DIR__ . '/persistent_static_fpm_006.log';
54+
$logFile = __DIR__ . '/pinned_static_fpm_006.log';
5555
5656
if ($request === 1) {
5757
@unlink($logFile);
@@ -65,12 +65,12 @@ if ($request === 1) {
6565
JitCombinedBlobState::$bag['numbers'][] = 10;
6666
JitCombinedBlobState::$bag['numbers'][] = 11;
6767
68-
echo persistent_static_jit_on(), ',', $last, ',', JitCombinedBlobState::$count, ',', array_sum(JitCombinedBlobState::$bag['numbers']), ',', count(file($logFile, FILE_IGNORE_NEW_LINES));
68+
echo pinned_static_jit_on(), ',', $last, ',', JitCombinedBlobState::$count, ',', array_sum(JitCombinedBlobState::$bag['numbers']), ',', count(file($logFile, FILE_IGNORE_NEW_LINES));
6969
return;
7070
}
7171
7272
if ($request === 2) {
73-
echo persistent_static_jit_on(), ',', JitCombinedBlobState::$count, ',', array_sum(JitCombinedBlobState::$bag['numbers']), ',', OPcache\persistent_cache_info()->entry_count, ',', count(file($logFile, FILE_IGNORE_NEW_LINES)), "\n";
73+
echo pinned_static_jit_on(), ',', JitCombinedBlobState::$count, ',', array_sum(JitCombinedBlobState::$bag['numbers']), ',', OPcache\pinned_cache_info()->entry_count, ',', count(file($logFile, FILE_IGNORE_NEW_LINES)), "\n";
7474
7575
$last = 0;
7676
for ($i = 0; $i < 4; $i++) {
@@ -83,13 +83,13 @@ if ($request === 2) {
8383
return;
8484
}
8585
86-
echo persistent_static_jit_on(), ',', JitCombinedBlobState::$count, ',', array_sum(JitCombinedBlobState::$bag['numbers']), ',', OPcache\persistent_cache_info()->entry_count, ',', count(file($logFile, FILE_IGNORE_NEW_LINES));
86+
echo pinned_static_jit_on(), ',', JitCombinedBlobState::$count, ',', array_sum(JitCombinedBlobState::$bag['numbers']), ',', OPcache\pinned_cache_info()->entry_count, ',', count(file($logFile, FILE_IGNORE_NEW_LINES));
8787
PHP;
8888

8989
$tester = new FPM\Tester($cfg, $code);
9090
$tester->start(iniEntries: [
9191
'opcache.enable' => '1',
92-
'opcache.static_cache.persistent_size_mb' => '32',
92+
'opcache.static_cache.pinned_size_mb' => '32',
9393
'opcache.file_update_protection' => '0',
9494
'opcache.jit' => 'tracing',
9595
'opcache.jit_buffer_size' => '64M',
@@ -117,5 +117,5 @@ Done
117117
<?php
118118
require_once __DIR__ . '/tester.inc';
119119
FPM\Tester::clean();
120-
@unlink(__DIR__ . '/persistent_static_fpm_006.log');
120+
@unlink(__DIR__ . '/pinned_static_fpm_006.log');
121121
?>

ext/opcache/tests/fpm/static_cache_fpm_persistent_static_class_blob_persistence_001.phpt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
--TEST--
2-
FPM: OPcache PersistentStatic class blob persists across requests
2+
FPM: OPcache PinnedStatic class blob persists across requests
33
--SKIPIF--
44
<?php include __DIR__ . '/skipif.inc'; ?>
55
--FILE--
@@ -20,7 +20,7 @@ EOT;
2020

2121
$code = <<<'PHP'
2222
<?php
23-
#[OPcache\PersistentStatic]
23+
#[OPcache\PinnedStatic]
2424
class CombinedBlobState
2525
{
2626
public static int $propertyCount = 0;
@@ -42,7 +42,7 @@ if ($request === 1) {
4242
return;
4343
}
4444
45-
echo CombinedBlobState::$propertyCount, ',', CombinedBlobState::$propertyBag['numbers'][0], ',', CombinedBlobState::nextMethod(), ',', OPcache\persistent_cache_info()->entry_count, "\n";
45+
echo CombinedBlobState::$propertyCount, ',', CombinedBlobState::$propertyBag['numbers'][0], ',', CombinedBlobState::nextMethod(), ',', OPcache\pinned_cache_info()->entry_count, "\n";
4646
4747
CombinedBlobState::$propertyCount++;
4848
CombinedBlobState::$propertyBag['numbers'][] = 11;
@@ -52,7 +52,7 @@ PHP;
5252
$tester = new FPM\Tester($cfg, $code);
5353
$tester->start(iniEntries: [
5454
'opcache.enable' => '1',
55-
'opcache.static_cache.persistent_size_mb' => '32',
55+
'opcache.static_cache.pinned_size_mb' => '32',
5656
]);
5757
$tester->expectLogStartNotices();
5858

ext/opcache/tests/fpm/static_cache_fpm_persistent_static_complex_value_persistence_001.phpt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
--TEST--
2-
FPM: OPcache PersistentStatic persists complex values across requests
2+
FPM: OPcache PinnedStatic persists complex values across requests
33
--SKIPIF--
44
<?php include __DIR__ . '/skipif.inc'; ?>
55
--FILE--
@@ -25,7 +25,7 @@ class CounterBox
2525
public function __construct(public int $value) {}
2626
}
2727
28-
#[OPcache\PersistentStatic]
28+
#[OPcache\PinnedStatic]
2929
class ComplexState
3030
{
3131
public static ?CounterBox $box = null;
@@ -63,7 +63,7 @@ PHP;
6363
$tester = new FPM\Tester($cfg, $code);
6464
$tester->start(iniEntries: [
6565
'opcache.enable' => '1',
66-
'opcache.static_cache.persistent_size_mb' => '32',
66+
'opcache.static_cache.pinned_size_mb' => '32',
6767
]);
6868
$tester->expectLogStartNotices();
6969

0 commit comments

Comments
 (0)