Tweaks to reduce deployed image size

db4
Slava Pestov 2009-09-24 06:24:43 -05:00
parent cb497f009b
commit 7ea8832556
4 changed files with 12 additions and 4 deletions

View File

@ -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." } ;

View File

@ -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

View File

@ -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
@ -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

View File

@ -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 -- )
@ -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