Skip to content

Commit

Permalink
Tweaks to reduce deployed image size
Browse files Browse the repository at this point in the history
  • Loading branch information
Slava Pestov committed Sep 24, 2009
1 parent 2ea0b9d commit a4e1d55
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
3 changes: 1 addition & 2 deletions basis/alien/c-types/c-types-docs.factor
Expand Up @@ -13,8 +13,7 @@ HELP: heap-size
{ $values { "type" string } { "size" math:integer } }
{ $description "Outputs the number of bytes needed for a heap-allocated value of this C type." }
{ $examples
"On a 32-bit system, you will get the following output:"
{ $unchecked-example "USE: alien\n\"void*\" heap-size ." "4" }
{ $example "USING: alien alien.c-types prettyprint ;\nint heap-size ." "4" }
}
{ $errors "Throws a " { $link no-c-type } " error if the type does not exist." } ;

Expand Down
2 changes: 1 addition & 1 deletion basis/alien/c-types/c-types.factor
Expand Up @@ -53,7 +53,7 @@ ERROR: no-c-type name ;
PREDICATE: c-type-word < word
"c-type" word-prop ;

UNION: c-type-name string c-type-word ;
UNION: c-type-name string word ;

! C type protocol
GENERIC: c-type ( name -- type ) foldable
Expand Down
5 changes: 4 additions & 1 deletion basis/compiler/tree/propagation/propagation-tests.factor
Expand Up @@ -9,7 +9,7 @@ compiler.tree.propagation.info compiler.tree.def-use
compiler.tree.debugger compiler.tree.checker
slots.private words hashtables classes assocs locals
specialized-arrays system sorting math.libm
math.intervals quotations effects alien ;
math.intervals quotations effects alien alien.data ;
FROM: math => float ;
SPECIALIZED-ARRAY: double
IN: compiler.tree.propagation.tests
Expand Down Expand Up @@ -894,3 +894,6 @@ M: tuple-with-read-only-slot clone
[ t ] [ [ >fixnum dup 0 >= [ 16 /i ] when ] { /i fixnum/i fixnum/i-fast } inlined? ] unit-test
[ f ] [ [ >fixnum dup 0 >= [ 16 /i ] when ] { fixnum-shift-fast } inlined? ] unit-test
[ f ] [ [ >float dup 0 >= [ 16 /i ] when ] { /i float/f } inlined? ] unit-test

! We want this to inline
[ t ] [ [ void* <c-direct-array> ] { <c-direct-array> } inlined? ] unit-test
6 changes: 6 additions & 0 deletions basis/tools/deploy/shaker/shaker.factor
Expand Up @@ -196,6 +196,10 @@ IN: tools.deploy.shaker
"word-style"
} %
] when

deploy-c-types? get [
{ "c-type" "struct-slots" "struct-size" "struct-align" } %
] unless
] { } make ;

: strip-words ( props -- )
Expand Down Expand Up @@ -345,6 +349,8 @@ IN: tools.deploy.shaker

{ } { "math.partial-dispatch" } strip-vocab-globals %

{ } { "math.vectors.simd" } strip-vocab-globals %

{ } { "peg" } strip-vocab-globals %
] when

Expand Down

0 comments on commit a4e1d55

Please sign in to comment.