manual:chapter6:system:cmd_newob

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
manual:chapter6:system:cmd_newob [2021/10/02 06:54]
jojo1973 created
manual:chapter6:system:cmd_newob [2021/10/04 04:54] (current)
jojo1973
Line 34: Line 34:
 <callout color="orangered" icon="fa fa-comment" title="Description"> <callout color="orangered" icon="fa fa-comment" title="Description">
 ---- ----
-The ''NEWOB'' command replaces an object on the stack with a new copy of itself. The command may seem pointless, but it solves a very specific problem: creating a new copy of an object that originated in a larger composite object (such as list) allows the garbage collection to __recover the memory associated with the larger object__ when that larger object is no longer needed.+The ''NEWOB'' command replaces an object on the stack with a new copy of itself.\\ 
 +\\ 
 +The command may seem pointless, but it solves a very specific problem: when an object originated from a larger composite object is extracted and put on the stack it contains reference to the parent object; even if the parent object is ''[[manual:chapter6:stack:cmd_drop|DROP]]''ped from the stack it keeps on living in the RAM, occupying precious resources.\\ 
 +\\ 
 +A copy of the extracted object created by ''NEWOB'' breaks this link and allows the ''[[manual:chapter6:system:cmd_garbage|GARBAGE]]'' collection to recover the memory associated with the larger object once it is not needed anymore.
 </callout> </callout>
  
  • manual/chapter6/system/cmd_newob.1633182843.txt.gz
  • Last modified: 2021/10/02 06:54
  • by jojo1973