more inlines on struct-arrays to make the optimizing go down smoother
parent
ad463795aa
commit
5376263984
|
@ -13,8 +13,8 @@ TUPLE: struct-array
|
||||||
{ element-size array-capacity read-only }
|
{ element-size array-capacity read-only }
|
||||||
{ class read-only } ;
|
{ class read-only } ;
|
||||||
|
|
||||||
M: struct-array length length>> ;
|
M: struct-array length length>> ; inline
|
||||||
M: struct-array byte-length [ length>> ] [ element-size>> ] bi * ;
|
M: struct-array byte-length [ length>> ] [ element-size>> ] bi * ; inline
|
||||||
|
|
||||||
: (nth-ptr) ( i struct-array -- alien )
|
: (nth-ptr) ( i struct-array -- alien )
|
||||||
[ element-size>> * ] [ underlying>> ] bi <displaced-alien> ; inline
|
[ element-size>> * ] [ underlying>> ] bi <displaced-alien> ; inline
|
||||||
|
@ -23,7 +23,7 @@ M: struct-array nth-unsafe
|
||||||
[ (nth-ptr) ] [ class>> dup struct-class? ] bi [ memory>struct ] [ drop ] if ; inline
|
[ (nth-ptr) ] [ class>> dup struct-class? ] bi [ memory>struct ] [ drop ] if ; inline
|
||||||
|
|
||||||
M: struct-array set-nth-unsafe
|
M: struct-array set-nth-unsafe
|
||||||
[ (nth-ptr) swap ] [ element-size>> ] bi memcpy ;
|
[ (nth-ptr) swap ] [ element-size>> ] bi memcpy ; inline
|
||||||
|
|
||||||
M: struct-array new-sequence
|
M: struct-array new-sequence
|
||||||
[ element-size>> [ * <byte-array> ] 2keep ]
|
[ element-size>> [ * <byte-array> ] 2keep ]
|
||||||
|
|
Loading…
Reference in New Issue