From e0068dc431537c5afa07f28ca3ccdf4a65aceef0 Mon Sep 17 00:00:00 2001 From: Prafulla Giri Date: Fri, 23 Oct 2020 18:36:50 +0545 Subject: [PATCH] Chapter 16: Fix typos. --- chapter16_bonus_projects.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chapter16_bonus_projects.html b/chapter16_bonus_projects.html index 40cbf74..0281545 100644 --- a/chapter16_bonus_projects.html +++ b/chapter16_bonus_projects.html @@ -79,7 +79,7 @@

Garbage Collection


Garbage Collection • Pick up that can.

-

If we store pointers to values, rather than copies, we need to ensure that the data pointed to is not delete before some other value tries to make use of it. We want to deleted it when there are no longer any references to it. One method to do this, called Mark and Sweep, is to monitor those values that are in the environment, as well as every value that has been allocated. When a variable is put into the environment it, and everything it references, is marked. Then, when we wish to free memory, we can then iterate over every allocation, and delete any that are not marked.

+

If we store pointers to values, rather than copies, we need to ensure that the data pointed to is not deleted before some other value tries to make use of it. We want to delete it when there are no longer any references to it. One method to do this, called Mark and Sweep, is to monitor those values that are in the environment, as well as every value that has been allocated. When a variable is put into the environment it, and everything it references, is marked. Then, when we wish to free memory, we can then iterate over every allocation, and delete any that are not marked.

This is called Garbage Collection and is an integral part to many programming languages. As with pool allocation, implementing a Garbage Collector does not need to be complicated, but it does need to be done carefully, in particularly if you wish to make it efficient. Implementing this would be essential to making this language practical for working with large amounts of data. A particularly good tutorial on implementing a garbage collector in C can be found here.