全部书籍

专业

应用 关于 Coach 登录 开始阅读

书籍暂未推出简体中文版——当前显示英文版。

Computer Science · 术语表

什么是 Copying collector, forwarding pointer?

又称: copying collector · forwarding pointer

Definition 9.7 University Computer Science — Year 3 · 第 9 章 — Memory Management and Garbage Collection

A copying collector splits the heap into two halves, from-space, where the program allocates, and to-space, kept empty. A collection copies every reachable cell of from-space into to-space, updates every reference to point at the copies, and swaps the two halves’ roles. When a cell is copied, its old place receives a forwarding pointer, the address of the copy, so that later references to it are redirected instead of copying it twice.

Cheney’s algorithm on the graph of exercise , after the root A was copied and scanned. A’s references were forwarded: B and C were copied and their old places hold forwarding pointers (to cells 1 and 2). E, garbage, is never touched. Scanning B next will copy D to cell 3.
Cheney’s algorithm on the graph of exercise 9.8, after the root A was copied and scanned. A’s references were forwarded: B and C were copied and their old places hold forwarding pointers (to cells 1 and 2). E, garbage, is never touched. Scanning B next will copy D to cell 3.
在原文中阅读 →