From 2b420656d6448cee20062f1ab620d376048104b2 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Thu, 2 Oct 2008 05:14:05 -0500 Subject: [PATCH] Tree shaker no longer loads threads into threadless images; 77kb improvement on hello-world size --- basis/tools/deploy/shaker/shaker.factor | 4 ++-- basis/tools/deploy/shaker/strip-debugger.factor | 10 ++++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/basis/tools/deploy/shaker/shaker.factor b/basis/tools/deploy/shaker/shaker.factor index 86393771de..f3177a76e1 100755 --- a/basis/tools/deploy/shaker/shaker.factor +++ b/basis/tools/deploy/shaker/shaker.factor @@ -13,7 +13,6 @@ QUALIFIED: compiler.errors.private QUALIFIED: continuations QUALIFIED: definitions QUALIFIED: init -QUALIFIED: io.thread QUALIFIED: layouts QUALIFIED: listener QUALIFIED: prettyprint.config @@ -214,13 +213,14 @@ IN: tools.deploy.shaker continuations:restarts listener:error-hook init:init-hooks - io.thread:io-thread source-files:source-files input-stream output-stream error-stream } % + "io-thread" "io.thread" lookup , + "mallocs" "libc.private" lookup , deploy-threads? [ diff --git a/basis/tools/deploy/shaker/strip-debugger.factor b/basis/tools/deploy/shaker/strip-debugger.factor index 2302b61715..bdcc6c237e 100755 --- a/basis/tools/deploy/shaker/strip-debugger.factor +++ b/basis/tools/deploy/shaker/strip-debugger.factor @@ -1,8 +1,14 @@ -USING: kernel threads threads.private ; +USING: compiler.units words vocabs kernel threads.private ; IN: debugger : print-error ( error -- ) die drop ; : error. ( error -- ) die drop ; -M: thread error-in-thread ( error thread -- ) die 2drop ; +"threads" vocab [ + [ + "error-in-thread" "threads" lookup + [ die 2drop ] + define + ] with-compilation-unit +] when