]> gitweb.factorcode.org Git - factor.git/commitdiff
Remove unsafe string allocation, since its of dubious value
authorSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Tue, 9 Dec 2008 23:53:00 +0000 (17:53 -0600)
committerSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Tue, 9 Dec 2008 23:53:00 +0000 (17:53 -0600)
basis/tools/walker/walker.factor
core/bootstrap/primitives.factor
core/sbufs/sbufs.factor
core/sequences/sequences.factor
core/strings/strings.factor

index a614e2eb0a72400fe64191fdf26eb7196486d902..8915d2d611bb19b3690b7248dd530fa80652b60d 100644 (file)
@@ -152,10 +152,6 @@ SYMBOL: +stopped+
     >n ndrop >c c>
     continue continue-with
     stop suspend (spawn)
-    ! Don't step into some sequence words since output of
-    ! (string) and new-sequence-unsafe may not print due to
-    ! memory safety issues
-    <sbuf> prepare-subseq subseq new-sequence-unsafe
 } [
     dup [ execute break ] curry
     "step-into" set-word-prop
index 79cc922f7864035a86beea2146724e171e1fa50c..6cc97531a4a790db5efb4eb24d289feaed8d37b6 100644 (file)
@@ -520,7 +520,6 @@ tuple
     { "<wrapper>" "kernel" }
     { "(clone)" "kernel" }
     { "<string>" "strings" }
-    { "(string)" "strings.private" }
     { "array>quotation" "quotations.private" }
     { "quotation-xt" "quotations" }
     { "<tuple>" "classes.tuple.private" }
index 0b6f089443d7b698c720a8b6d80faf7e6185bf0f..5590432ef4ca3908facee7aadd6fb31fcb704b26 100644 (file)
@@ -8,7 +8,7 @@ TUPLE: sbuf
 { underlying string }
 { length array-capacity } ;
 
-: <sbuf> ( n -- sbuf ) (string) 0 sbuf boa ; inline
+: <sbuf> ( n -- sbuf ) 0 <string> 0 sbuf boa ; inline
 
 M: sbuf set-nth-unsafe
     [ >fixnum ] [ >fixnum ] [ underlying>> ] tri* set-string-nth ;
index 8083cffe972e9ac631982fdeadca6eccdf8816e4..8c9eff94f514d2dfc1f52d3c915f478c0b74bd15 100644 (file)
@@ -81,7 +81,6 @@ GENERIC: resize ( n seq -- newseq ) flushable
 ! Unsafe sequence protocol for inner loops
 GENERIC: nth-unsafe ( n seq -- elt ) flushable
 GENERIC: set-nth-unsafe ( elt n seq -- )
-GENERIC: new-sequence-unsafe ( len seq -- newseq ) flushable
 
 M: sequence nth bounds-check nth-unsafe ;
 M: sequence set-nth bounds-check set-nth-unsafe ;
@@ -89,8 +88,6 @@ M: sequence set-nth bounds-check set-nth-unsafe ;
 M: sequence nth-unsafe nth ;
 M: sequence set-nth-unsafe set-nth ;
 
-M: sequence new-sequence-unsafe new-sequence ;
-
 ! The f object supports the sequence protocol trivially
 M: f length drop 0 ;
 M: f nth-unsafe nip ;
@@ -259,7 +256,7 @@ INSTANCE: repetition immutable-sequence
 
 : prepare-subseq ( from to seq -- dst i src j n )
     #! The check-length call forces partial dispatch
-    [ [ swap - ] dip new-sequence-unsafe dup 0 ] 3keep
+    [ [ swap - ] dip new-sequence dup 0 ] 3keep
     -rot drop roll length check-length ; inline
 
 : check-copy ( src n dst -- )
index 6da7bfce0d57c96183150de3aca15d17c4c061aa..0c3f918fdca03879a8dd65c817b2e94272b0e8a6 100644 (file)
@@ -56,6 +56,4 @@ M: string resize resize-string ;
 
 M: string new-sequence drop 0 <string> ;
 
-M: string new-sequence-unsafe drop (string) ;
-
 INSTANCE: string sequence