USING: init command-line debugger system continuations
-namespaces eval kernel vocabs.loader io ;
+namespaces eval kernel vocabs.loader io destructors ;
[
boot
- do-startup-hooks
[
- (command-line) parse-command-line
- load-vocab-roots
- run-user-init
- "e" get [ eval( -- ) ] when*
- ignore-cli-args? not script get and
- [ run-script ] [ "run" get run ] if*
- output-stream get [ stream-flush ] when*
- 0 exit
- ] [ print-error 1 exit ] recover
+ do-startup-hooks
+ [
+ (command-line) parse-command-line
+ load-vocab-roots
+ run-user-init
+ "e" get [ eval( -- ) ] when*
+ ignore-cli-args? not script get and
+ [ run-script ] [ "run" get run ] if*
+ output-stream get [ stream-flush ] when*
+ 0
+ ] [ print-error 1 ] recover
+ ] with-destructors exit
] set-boot-quot
[
boot
- do-startup-hooks
- (command-line) parse-command-line
- "run" get run
- output-stream get [ stream-flush ] when*
- 0 exit
+ [
+ do-startup-hooks
+ (command-line) parse-command-line
+ "run" get run
+ output-stream get [ stream-flush ] when*
+ ] with-destructors 0 exit
] set-boot-quot
error-continuation set-global
error set-global ; inline
+
[
! We time bootstrap
millis
CONSTANT: packet-size 65536
-[ packet-size malloc receive-buffer set-global ] "io.sockets.unix" add-startup-hook
-[ receive-buffer get-global free ] "io.sockets.unix" add-shutdown-hook
+[ packet-size malloc &free receive-buffer set-global ] "io.sockets.unix" add-startup-hook
:: do-receive ( port -- packet sockaddr )
port addr>> empty-sockaddr/size :> len :> sockaddr
os openbsd? [
[
- "/dev/srandom" <unix-random> secure-random-generator set-global
- "/dev/arandom" <unix-random> system-random-generator set-global
+ "/dev/srandom" <unix-random> &dispose secure-random-generator set-global
+ "/dev/arandom" <unix-random> &dispose system-random-generator set-global
] "random.unix" add-startup-hook
] [
[
- "/dev/random" <unix-random> secure-random-generator set-global
- "/dev/urandom" <unix-random> system-random-generator set-global
+ "/dev/random" <unix-random> &dispose secure-random-generator set-global
+ "/dev/urandom" <unix-random> &dispose system-random-generator set-global
] "random.unix" add-startup-hook
] if
-
-[
- [
- secure-random-generator get-global &dispose drop
- system-random-generator get-global &dispose drop
- ] with-destructors
-] "random.unix" add-shutdown-hook
: cached-script-string ( font string -- script-string )
cached-script-strings get-global [ <script-string> ] 2cache ;
-[ <cache-assoc> cached-script-strings set-global ]
+[ <cache-assoc> &dispose cached-script-strings set-global ]
"windows.uniscribe" add-startup-hook
-
-[ cached-script-strings get-global dispose ]
-"windows.uniscribe" add-shutdown-hook
USING: arrays assocs continuations debugger generic hashtables
init io io.files kernel kernel.private make math memory
namespaces parser prettyprint sequences splitting system
-vectors vocabs vocabs.loader words ;
+vectors vocabs vocabs.loader words destructors ;
QUALIFIED: bootstrap.image.private
IN: bootstrap.stage1
[
"resource:basis/bootstrap/stage2.factor"
dup exists? [
- run-file
+ [ run-file ] with-destructors
] [
"Cannot find " write write "." print
"Please move " write image write " to the same directory as the Factor sources," print