Commit 723d8e4
committed
Editor: Free up transient memory leak in
There has been a memory inefficiency inside of `do_blocks()` where it
parses the given content then iterates through each top-level block to
render it. Unfortunately each top-level block can considerably add to
the overall memory use involved, and once moving on to the next
top-level block, all of the allocated memory will be retained until the
end of the call to `do_blocks()`.
In this change, each parsed block sub-tree is freed via reset to null
after it has been rendered. All top-level blocks are rendered
independently of each other and so this operation is safe — there are no
data dependencies between them.
This commit also includes follow-up changes committed in [60400] and [60402].
Rewieved by audrasjb.
Merges [60316], [60400] and [60402] to the 6.8 branch.
Props dmsnell, joemcgill.
Fixes #63588.
git-svn-id: https://develop.svn.wordpress.org/branches/6.8@60435 602fd350-edb4-49c9-b593-d223f7449a82do_blocks().1 parent f3e7d3a commit 723d8e4
1 file changed
+25
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2404 | 2404 | | |
2405 | 2405 | | |
2406 | 2406 | | |
2407 | | - | |
2408 | | - | |
| 2407 | + | |
| 2408 | + | |
| 2409 | + | |
2409 | 2410 | | |
2410 | | - | |
2411 | | - | |
| 2411 | + | |
| 2412 | + | |
| 2413 | + | |
| 2414 | + | |
| 2415 | + | |
| 2416 | + | |
| 2417 | + | |
| 2418 | + | |
| 2419 | + | |
| 2420 | + | |
| 2421 | + | |
| 2422 | + | |
| 2423 | + | |
| 2424 | + | |
| 2425 | + | |
| 2426 | + | |
| 2427 | + | |
| 2428 | + | |
| 2429 | + | |
| 2430 | + | |
| 2431 | + | |
| 2432 | + | |
2412 | 2433 | | |
2413 | 2434 | | |
2414 | 2435 | | |
| |||
0 commit comments