]> gitweb.factorcode.org Git - factor.git/commitdiff
Tweaks to reduce deployed image size
authorSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Thu, 24 Sep 2009 11:24:43 +0000 (06:24 -0500)
committerSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Thu, 24 Sep 2009 11:24:43 +0000 (06:24 -0500)
basis/alien/c-types/c-types-docs.factor
basis/alien/c-types/c-types.factor
basis/compiler/tree/propagation/propagation-tests.factor
basis/tools/deploy/shaker/shaker.factor

index 390477dcac738a4646efd5089002544f04c95339..8b5a526e827d386655a2c5985987607aa371dcdd 100755 (executable)
@@ -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." } ;
 
index 0ed111c077f2945153a18afdeff56684ebcea8b7..9aea6fe252e6b92774072a2dec4539033c83dd4f 100755 (executable)
@@ -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
index b436b21329f84fc4e02accee8f3f76343fd849cc..79016585f6b9b852cd2979defe7a87257ab8f674 100644 (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
index 42d1ee2a9fbe4f0a49eb4d563b4dc6ef12b213da..2b4c38beaf8d9f7ac15f4154b68377e520f02fc2 100755 (executable)
@@ -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