Skip to content

Commit

Permalink
Improved Zend Memory Manager to guarantee reasonable time for worst c…
Browse files Browse the repository at this point in the history
…ases of best-fit free block searching algorithm.
  • Loading branch information
dstogov committed Mar 20, 2007
1 parent 13aac95 commit d514bf2
Show file tree
Hide file tree
Showing 5 changed files with 665 additions and 330 deletions.
5 changes: 5 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ PHP NEWS
- Upgraded SQLite 3 to version 3.3.13 (Ilia)
- Upgraded PCRE to version 7.0 (Nuno)
- Updated timezone database to version 2007.3. (Derick)
- Improved Zend Memory Manager to guarantee reasonable time for worst cases
of best-fit free block searching algorithm. (Dmitry)
- Improved SPL (Marcus)
. Added SplFileInfo::getBasename(), DirectoryIterator::getBasename().
. Added SplFileInfo::getLinkTarget(), SplFileInfo::getRealPath().
Expand All @@ -29,6 +31,7 @@ PHP NEWS
via __get()). (Dmitry)
- Fixed bug #40815 (using strings like "class::func" and static methods in
set_exception_handler() might result in crash). (Tony)
- Fixed bug #40809 (Poor perfomance of ".="). (Dmitry)
- Fixed bug #40805 (Failure executing function ibase_execute()). (Tony)
- Fixed bug #40800 (cannot disable memory_limit with -1). (Dmitry, Tony)
- Fixed bug #40794 (ReflectionObject::getValues() may crash when used with
Expand Down Expand Up @@ -90,6 +93,8 @@ PHP NEWS
- Fixed Bug #40352 (FCGI_WEB_SERVER_ADDRS function get lost). (Dmitry)
- Fixed bug #40286 (PHP fastcgi with PHP_FCGI_CHILDREN don't kill children when
parent is killed). (Dmitry)
- Fixed bug #40261 (Extremely slow data handling due to memory fragmentation).
(Dmitry)
- Fixed bug #40236 (php -a function allocation eats memory). (Dmitry)
- Fixed bug #40109 (iptcembed fails on non-jfif jpegs). (Tony)
- Fixed bug #39836 (SplObjectStorage empty after unserialize). (Marcus)
Expand Down
25 changes: 25 additions & 0 deletions Zend/tests/bug40261.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
--TEST--
Bug #40261 (Extremely slow data handling due to memory fragmentation)
--INI--
memory_limit=128M
--FILE--
<?php
$num = 100000;

$a = Array();
for ($i=0; $i<$num; $i++) {
$a[$i] = Array(1);
}

for ($i=0; $i<$num; $i++) {
$b[$i] = $a[$i][0];
}

unset($a);
for ($i=0; $i<$num; $i++) {
$b[$i] = "12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890";
}
echo "ok\n";
?>
--EXPECT--
ok
33 changes: 33 additions & 0 deletions Zend/tests/bug40809.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
--TEST--
Bug #40809 Poor perfomance of ".="
--FILE--
<?php
error_reporting(E_ALL|E_STRICT);

$num_increments = 100;
$num_repeats = 1000;
$increment = 50;

/* Create some more holes to give the memory allocator something to
* work with. */
$num = 5000;
$a = Array();
for ($i=0; $i<$num; $i++) {
$a[$i] = Array(1);
}
for ($i=0; $i<$num; $i++) {
$b[$i] = $a[$i][0];
}
unset($a);

for ($i=0;$i<$num_repeats;$i++) {
$evil = "";
for ($j=0;$j<$num_increments;$j++) {
$evil .= str_repeat("a", $increment);
}
unset($evil);
}
echo "ok\n";
?>
--EXPECT--
ok
Loading

0 comments on commit d514bf2

Please sign in to comment.