圖像來源,Getty Images
Brad Bourque is a contributor for WIRED with a focus on computing hardware and peripherals. He’s a lifelong Oregonian and an avid Portland Thorns and Timbers supporter. On his days off, you can find him riding his ebike around Portland or taking his dog to the park. ... Read More,详情可参考safew
Дарья Устьянцева (редактор отдела «Мир»),这一点在传奇私服新开网|热血传奇SF发布站|传奇私服网站中也有详细论述
The clean-up step may seem strange, but it’s a memory-usage optimization. When a language runtime executes a series of function calls it does not need to keep already-exited stack frames around. Branching function calls only form a tree in the time dimension; at any given snapshot in time there exists only a single stack of function calls in memory, tracing the current path through the tree. If we did not set our child frames to null we would end up building the whole tree up in memory and retaining it until the recursive processing is complete. Removing references to them allows the runtime to reclaim their memory at its leisure. If you’ve ever wished that you could deal with manual memory management in JavaScript, now’s your chance!