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 ;
6 PRIMITIVE: all-instances ( -- array )
7 PRIMITIVE: compact-gc ( -- )
9 PRIMITIVE: minor-gc ( -- )
10 PRIMITIVE: size ( obj -- n )
13 PRIMITIVE: (save-image) ( path1 path2 then-die? -- )
16 : instances ( quot -- seq )
17 [ all-instances ] dip filter ; inline
19 : saving-path ( path -- saving-path path )
20 [ ".saving" append ] keep
21 [ native-string>alien ] bi@ ;
23 : save-image ( path -- )
24 normalize-path saving-path f (save-image) ;
26 : save-image-and-exit ( path -- )
27 normalize-path saving-path t (save-image) ;
29 : save ( -- ) image-path save-image ;