PageRenderTime 33ms CodeModel.GetById 12ms app.highlight 17ms RepoModel.GetById 1ms app.codeStats 1ms

/core/memory/memory-docs.factor

http://github.com/abeaumont/factor
Unknown | 47 lines | 38 code | 9 blank | 0 comment | 0 complexity | 1f6324bcc417552fa75ab9f2f67d8651 MD5 | raw file
 1USING: help.markup help.syntax debugger sequences kernel
 2quotations math ;
 3IN: memory
 4
 5HELP: instances
 6{ $values { "quot" { $quotation "( obj -- ? )" } } { "seq" "a fresh sequence" } }
 7{ $description "Outputs a sequence of all objects in the heap which satisfy the quotation." } ;
 8
 9HELP: gc
10{ $description "Performs a full garbage collection." } ;
11
12HELP: size
13{ $values { "obj" "an object" } { "n" "a size in bytes" } }
14{ $description "Outputs the size of the object in memory, in bytes. Tagged immediate objects such as fixnums and " { $link f } " will yield a size of 0." } ;
15
16HELP: save-image
17{ $values { "path" "a pathname string" } }
18{ $description "Saves a snapshot of the heap to the given file, overwriting the file if it already exists." } ;
19
20HELP: save-image-and-exit
21{ $values { "path" "a pathname string" } }
22{ $description "Saves a snapshot of the heap to the given file, overwriting the file if it already exists. This word compacts the code heap and immediately exits Factor, since the Factor VM cannot continue executing after compiled code blocks have been moved around." } ;
23
24{ save save-image save-image-and-exit } related-words
25
26HELP: save
27{ $description "Saves a snapshot of the heap to the current image file." } ;
28
29ARTICLE: "images" "Images"
30"Factor has the ability to save the entire state of the system into an " { $emphasis "image file" } ". The image contains a complete dump of all data and code in the current Factor instance."
31{ $subsections
32    save
33    save-image
34    save-image-and-exit
35}
36"To start Factor with a custom image, use the " { $snippet "-i=" { $emphasis "image" } } " command line switch; see " { $link "runtime-cli-args" } "."
37$nl
38"One reason to save a custom image is if you find yourself loading the same libraries in every Factor session; some libraries take a little while to compile, so saving an image with those libraries loaded can save you a lot of time."
39$nl
40"For example, to save an image with the web framework loaded,"
41{ $code "USE: furnace" "save" }
42"New images can be created from scratch:"
43{ $subsections "bootstrap.image" }
44"The " { $link "tools.deploy" } " tool creates stripped-down images containing just enough code to run a single application."
45{ $see-also "tools.memory" } ;
46
47ABOUT: "images"