]> gitweb.factorcode.org Git - factor.git/blob - core/memory/memory.factor
vm: fix arm files
[factor.git] / core / memory / memory.factor
1 ! Copyright (C) 2005, 2009 Slava Pestov.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: alien.strings io.backend kernel sequences system ;
4 IN: memory
5
6 PRIMITIVE: all-instances ( -- array )
7 PRIMITIVE: compact-gc ( -- )
8 PRIMITIVE: gc ( -- )
9 PRIMITIVE: minor-gc ( -- )
10 PRIMITIVE: size ( obj -- n )
11
12 <PRIVATE
13 PRIMITIVE: (save-image) ( path1 path2 then-die? -- )
14 PRIVATE>
15
16 : instances ( quot -- seq )
17     [ all-instances ] dip filter ; inline
18
19 : saving-path ( path -- saving-path path )
20     [ ".saving" append ] keep
21     [ native-string>alien ] bi@ ;
22
23 : save-image ( path -- )
24     normalize-path saving-path f (save-image) ;
25
26 : save-image-and-exit ( path -- )
27     normalize-path saving-path t (save-image) ;
28
29 : save ( -- ) image-path save-image ;