document count-instances
parent
3d7ed0f122
commit
6f91454cf3
|
@ -1,19 +1,7 @@
|
||||||
USING: help.markup help.syntax debugger sequences kernel ;
|
USING: help.markup help.syntax debugger sequences kernel
|
||||||
|
quotations math ;
|
||||||
IN: memory
|
IN: memory
|
||||||
|
|
||||||
ARTICLE: "images" "Images"
|
|
||||||
"The current image can be saved; the image contains a complete dump of all data and code in the current Factor instance:"
|
|
||||||
{ $subsection save }
|
|
||||||
{ $subsection save-image }
|
|
||||||
{ $subsection save-image-and-exit }
|
|
||||||
"To start Factor with a custom image, use the " { $snippet "-i=" { $emphasis "image" } } " command line switch; see " { $link "runtime-cli-args" } "."
|
|
||||||
$nl
|
|
||||||
"New images can be created from scratch:"
|
|
||||||
{ $subsection "bootstrap.image" }
|
|
||||||
{ $see-also "tools.memory" "tools.deploy" } ;
|
|
||||||
|
|
||||||
ABOUT: "images"
|
|
||||||
|
|
||||||
HELP: begin-scan ( -- )
|
HELP: begin-scan ( -- )
|
||||||
{ $description "Moves all objects to tenured space, disables the garbage collector, and resets the heap scan pointer to point at the first object in the heap. The " { $link next-object } " word can then be called to advance the heap scan pointer and return successive objects."
|
{ $description "Moves all objects to tenured space, disables the garbage collector, and resets the heap scan pointer to point at the first object in the heap. The " { $link next-object } " word can then be called to advance the heap scan pointer and return successive objects."
|
||||||
$nl
|
$nl
|
||||||
|
@ -67,3 +55,27 @@ HELP: save-image-and-exit ( path -- )
|
||||||
|
|
||||||
HELP: save
|
HELP: save
|
||||||
{ $description "Saves a snapshot of the heap to the current image file." } ;
|
{ $description "Saves a snapshot of the heap to the current image file." } ;
|
||||||
|
|
||||||
|
HELP: count-instances
|
||||||
|
{ $values
|
||||||
|
{ "quot" quotation }
|
||||||
|
{ "n" integer } }
|
||||||
|
{ $description "Applies the predicate quotation to each object in the heap and returns the number of objects that match. Since this word uses " { $link each-object } " with the garbage collector switched off, avoid allocating too much memory in the quotation." }
|
||||||
|
{ $examples { $unchecked-example
|
||||||
|
"USING: memory words prettyprint ;"
|
||||||
|
"[ word? ] count-instances ."
|
||||||
|
"24210"
|
||||||
|
} } ;
|
||||||
|
|
||||||
|
ARTICLE: "images" "Images"
|
||||||
|
"The current image can be saved; the image contains a complete dump of all data and code in the current Factor instance:"
|
||||||
|
{ $subsection save }
|
||||||
|
{ $subsection save-image }
|
||||||
|
{ $subsection save-image-and-exit }
|
||||||
|
"To start Factor with a custom image, use the " { $snippet "-i=" { $emphasis "image" } } " command line switch; see " { $link "runtime-cli-args" } "."
|
||||||
|
$nl
|
||||||
|
"New images can be created from scratch:"
|
||||||
|
{ $subsection "bootstrap.image" }
|
||||||
|
{ $see-also "tools.memory" "tools.deploy" } ;
|
||||||
|
|
||||||
|
ABOUT: "images"
|
||||||
|
|
Loading…
Reference in New Issue