1 ! Copyright (C) 2005, 2009 Slava Pestov.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: alien.strings io.backend kernel memory.private sequences
7 PRIMITIVE: all-instances ( -- array )
8 PRIMITIVE: compact-gc ( -- )
10 PRIMITIVE: minor-gc ( -- )
11 PRIMITIVE: size ( obj -- n )
14 PRIMITIVE: (save-image) ( path1 path2 -- )
15 PRIMITIVE: (save-image-and-exit) ( path1 path2 -- )
18 : instances ( quot -- seq )
19 [ all-instances ] dip filter ; inline
21 : saving-path ( path -- saving-path path )
22 [ ".saving" append ] keep
23 [ native-string>alien ] bi@ ;
25 : save-image ( path -- )
26 normalize-path saving-path (save-image) ;
28 : save-image-and-exit ( path -- )
29 normalize-path saving-path (save-image-and-exit) ;
31 : save ( -- ) image save-image ;