diff options
| author | Nikita Popov <nikita.ppv@gmail.com> | 2020-10-15 16:42:59 +0200 |
|---|---|---|
| committer | Nikita Popov <nikita.ppv@gmail.com> | 2020-10-22 10:25:25 +0200 |
| commit | dd4a080133b7b0570b629cdfb7c9e2651bdf88f7 (patch) | |
| tree | b4b8ed5ca117f0870d86d0e6eb2e2c0ef770e915 /ext/pcre/php_pcre.c | |
| parent | ac87880addfd22e651b210346178dc1ed851b1dd (diff) | |
| download | php-git-dd4a080133b7b0570b629cdfb7c9e2651bdf88f7.tar.gz | |
Simplify and fix generator tree management
This makes a number of related changes to the generator tree
management, that should hopefully make it easier to understand,
more robust and faster for the common linear-chain case. Fixes
https://bugs.php.net/bug.php?id=80240, which was the original
motivation here.
* Generators now only add a ref to their direct parent.
* Nodes only store their children, not their leafs, which avoids
any need for leaf updating. This means it's no longer possible
to fetch the child for a certain leaf, which is something we
only needed in one place (update_current). If multi-children
nodes are involved, this will require doing a walk in the other
direction (from leaf to root). It does not affect the common
case of single-child nodes.
* The root/leaf pointers are now seen as a pair. One leaf generator
can point to the current root. If a different leaf generator is
used, we'll move the root pointer over to that one. Again, this
is a cache to make the common linear chain case fast, trees may
need to scan up the parent link.
Closes GH-6344.
Diffstat (limited to 'ext/pcre/php_pcre.c')
0 files changed, 0 insertions, 0 deletions
