-
Notifications
You must be signed in to change notification settings - Fork 198
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix bug in serializing php 8.2 lists, reduce memory usage.
Starting in php 8.2, zvals are stored instead of Buckets, halving the memory usage per extra element. Use the same memory allocation when unserializing data and when storing data in shared memory in php 8.2. This was previously copying too much data when there was an associative array instead of a list, and apc_025.phpt would fail with valgrind. Related to #323
- Loading branch information
1 parent
98b2616
commit 11de4db
Showing
3 changed files
with
52 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
--TEST-- | ||
APC: apcu_fetch of packed array | ||
--SKIPIF-- | ||
<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> | ||
--INI-- | ||
apc.enabled=1 | ||
apc.enable_cli=1 | ||
--FILE-- | ||
<?php | ||
var_dump(apcu_store('foo', [1, 2, 3, 4, 5, 6, 7, 8])); | ||
var_dump(apcu_fetch('foo')); | ||
|
||
?> | ||
--EXPECT-- | ||
bool(true) | ||
array(8) { | ||
[0]=> | ||
int(1) | ||
[1]=> | ||
int(2) | ||
[2]=> | ||
int(3) | ||
[3]=> | ||
int(4) | ||
[4]=> | ||
int(5) | ||
[5]=> | ||
int(6) | ||
[6]=> | ||
int(7) | ||
[7]=> | ||
int(8) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters