]> gitweb.factorcode.org Git - factor.git/commitdiff
Finish up O(1) byte array allocation
authorSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Wed, 10 Dec 2008 00:17:04 +0000 (18:17 -0600)
committerSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Wed, 10 Dec 2008 00:17:04 +0000 (18:17 -0600)
basis/alien/c-types/c-types.factor
basis/bootstrap/stage2.factor
basis/compiler/tree/propagation/slots/slots.factor
core/sequences/sequences-docs.factor
vm/primitives.c
vm/types.c

index c3ae644b47856cf1b4cd436a306a7ab408da1e6d..ae148e3ac06f6263c204934bc5b21dc30fdd793f 100644 (file)
@@ -204,7 +204,7 @@ M: byte-array byte-length length ;
     dup length [ nip malloc dup ] 2keep memcpy ;
 
 : memory>byte-array ( alien len -- byte-array )
-    [ nip <byte-array> dup ] 2keep memcpy ;
+    [ nip (byte-array) dup ] 2keep memcpy ;
 
 : byte-array>memory ( byte-array base -- )
     swap dup length memcpy ;
index 78355a46702b383edf3536450ae5e6856cb430ad..fb7292b989caaa7508711711a014c8d935dc27f7 100644 (file)
@@ -100,4 +100,8 @@ SYMBOL: bootstrap-time
 
         "output-image" get save-image-and-exit
     ] if
-] [ drop "resource:basis/bootstrap/bootstrap-error.factor" run-file ] recover
+] [
+    drop
+    load-help? off
+    "resource:basis/bootstrap/bootstrap-error.factor" run-file
+] recover
index 83e71c336314c6201cbb2a5526ba1d633f63857b..8192b1c5209b3ad3b1f4d3e3990d69f112792919 100644 (file)
@@ -14,12 +14,13 @@ IN: compiler.tree.propagation.slots
 UNION: fixed-length-sequence array byte-array string ;
 
 : sequence-constructor? ( word -- ? )
-    { <array> <byte-array> <string> } memq? ;
+    { <array> <byte-array> (byte-array) <string> } memq? ;
 
 : constructor-output-class ( word -- class )
     {
         { <array> array }
         { <byte-array> byte-array }
+        { (byte-array) byte-array }
         { <string> string }
     } at ;
 
index a78117c35f03064f489e0afc603d44ca114c42f0..7354759bb6a834c91ef1ce6fa776777e1a42c526 100644 (file)
@@ -1,6 +1,6 @@
 USING: arrays help.markup help.syntax math
 sequences.private vectors strings kernel math.order layouts
-quotations ;
+quotations generic.standard ;
 IN: sequences
 
 HELP: sequence
@@ -14,8 +14,8 @@ HELP: length
 
 HELP: set-length
 { $values { "n" "a non-negative integer" } { "seq" "a resizable sequence" } }
-{ $contract "Resizes the sequence. Not all sequences are resizable." }
-{ $errors "Throws a " { $link bounds-error } " if the new length is negative." }
+{ $contract "Resizes a sequence. The initial contents of the new area is undefined." }
+{ $errors "Throws a " { $link no-method  } " error if the sequence is not resizable, and a " { $link bounds-error } " if the new length is negative." }
 { $side-effects "seq" } ;
 
 HELP: lengthen
index 142db9e2048d695c15f47aecae66d704136604f3..dcf082d40d86304406c684cd4d75137c1ff1b88b 100755 (executable)
@@ -126,7 +126,6 @@ void *primitives[] = {
        primitive_wrapper,
        primitive_clone,
        primitive_string,
-       primitive_uninitialized_string,
        primitive_array_to_quotation,
        primitive_quotation_xt,
        primitive_tuple,
index 4a598dc601d5088a9f92bcaab81bc873c6ca09f0..c9e657f8ee3ba2693b9c8ac52c5ecbcad20dc80f 100755 (executable)
@@ -256,7 +256,7 @@ F_BYTE_ARRAY *reallot_byte_array(F_BYTE_ARRAY *array, CELL capacity)
                to_copy = capacity;
 
        REGISTER_UNTAGGED(array);
-       F_BYTE_ARRAY *new_array = allot_byte_array(capacity);
+       F_BYTE_ARRAY *new_array = allot_byte_array_internal(capacity);
        UNREGISTER_UNTAGGED(array);
 
        memcpy(new_array + 1,array + 1,to_copy);