@@ -742,7 +742,7 @@ ndigits(x::Integer; base::Integer=10, pad::Integer=1) = max(pad, ndigits0z(x, ba
742742function bin (x:: Unsigned , pad:: Int , neg:: Bool )
743743 m = top_set_bit (x)
744744 n = neg + max (pad, m)
745- a = StringVector (n)
745+ a = StringMemory (n)
746746 # for i in 0x0:UInt(n-1) # automatic vectorization produces redundant codes
747747 # @inbounds a[n - i] = 0x30 + (((x >> i) % UInt8)::UInt8 & 0x1)
748748 # end
769769function oct (x:: Unsigned , pad:: Int , neg:: Bool )
770770 m = div (top_set_bit (x) + 2 , 3 )
771771 n = neg + max (pad, m)
772- a = StringVector (n)
772+ a = StringMemory (n)
773773 i = n
774774 while i > neg
775775 @inbounds a[i] = 0x30 + ((x % UInt8):: UInt8 & 0x7 )
844844
845845function dec (x:: Unsigned , pad:: Int , neg:: Bool )
846846 n = neg + ndigits (x, pad= pad)
847- a = StringVector (n)
847+ a = StringMemory (n)
848848 append_c_digits_fast (n, x, a, 1 )
849849 neg && (@inbounds a[1 ] = 0x2d ) # UInt8('-')
850850 String (a)
853853function hex (x:: Unsigned , pad:: Int , neg:: Bool )
854854 m = 2 * sizeof (x) - (leading_zeros (x) >> 2 )
855855 n = neg + max (pad, m)
856- a = StringVector (n)
856+ a = StringMemory (n)
857857 i = n
858858 while i >= 2
859859 b = (x % UInt8):: UInt8
@@ -880,7 +880,7 @@ function _base(base::Integer, x::Integer, pad::Int, neg::Bool)
880880 b = (base % Int):: Int
881881 digits = abs (b) <= 36 ? base36digits : base62digits
882882 n = neg + ndigits (x, base= b, pad= pad)
883- a = StringVector (n)
883+ a = StringMemory (n)
884884 i = n
885885 @inbounds while i > neg
886886 if b > 0
@@ -956,7 +956,7 @@ julia> bitstring(2.2)
956956function bitstring (x:: T ) where {T}
957957 isprimitivetype (T) || throw (ArgumentError (" $T not a primitive type" ))
958958 sz = sizeof (T) * 8
959- str = StringVector (sz)
959+ str = StringMemory (sz)
960960 i = sz
961961 @inbounds while i >= 4
962962 b = UInt32 (sizeof (T) == 1 ? bitcast (UInt8, x) : trunc_int (UInt8, x))
0 commit comments