point-array


Vocabulary
specialized-arrays.instances.benchmark.struct-arrays.point

Definition
USING: alien sequences.private ;

IN: specialized-arrays.instances.benchmark.struct-arrays.point

TUPLE: point-array
{ underlying c-ptr read-only initial: f }
{ length array-capacity read-only initial: 0 } ; final


Methods
USING: prettyprint.custom
specialized-arrays.instances.benchmark.struct-arrays.point ;

M: point-array >pprint-sequence ;


USING: accessors kernel
specialized-arrays.instances.benchmark.struct-arrays.point ;

M: point-array clone
[ underlying>> clone ] [ length>> ] bi <direct-point-array>
; inline


USING: kernel
specialized-arrays.instances.benchmark.struct-arrays.point
specialized-arrays.private ;

M: point-array direct-like drop <direct-point-array> ; inline


USING: alien alien.c-types benchmark.struct-arrays kernel
specialized-arrays.instances.benchmark.struct-arrays.point ;

M: point-array element-size drop \ point heap-size ; inline


USING: classes kernel sequences
specialized-arrays.instances.benchmark.struct-arrays.point ;

M: point-array equal?
over point-array instance? [ sequence= ] [ 2drop f ] if ;


USING: accessors sequences
specialized-arrays.instances.benchmark.struct-arrays.point ;

M: point-array length length>> ; inline


USING: alien.data benchmark.struct-arrays classes kernel
sequences
specialized-arrays.instances.benchmark.struct-arrays.point ;

M: point-array like
drop dup point-array instance? [ \ point >c-array ] unless
; inline


USING: kernel sequences
specialized-arrays.instances.benchmark.struct-arrays.point ;

M: point-array new-sequence drop (point-array) ; inline


USING: accessors alien alien.c-types benchmark.struct-arrays
kernel
specialized-arrays.instances.benchmark.struct-arrays.point
specialized-arrays.private ;

M: point-array nth-c-ptr
underlying>> \ point array-accessor drop
swap <displaced-alien> ; inline


USING: accessors alien.c-types benchmark.struct-arrays
sequences.private
specialized-arrays.instances.benchmark.struct-arrays.point ;

M: point-array nth-unsafe
underlying>> \ point alien-element ; inline


USING: kernel prettyprint.custom
specialized-arrays.instances.benchmark.struct-arrays.point ;

M: point-array pprint-delims drop \ point-array{ \ } ;


USING: accessors alien.c-types benchmark.struct-arrays
byte-arrays kernel math sequences.private
specialized-arrays.instances.benchmark.struct-arrays.point ;

M: point-array resize
[
[ \ point heap-size * ] [ underlying>> ] bi*
resize-byte-array
] [ drop ] 2bi <direct-point-array> ; inline


USING: accessors alien.c-types benchmark.struct-arrays
sequences.private
specialized-arrays.instances.benchmark.struct-arrays.point ;

M: point-array set-nth-unsafe
underlying>> \ point set-alien-element ; inline


USING: benchmark.struct-arrays kernel specialized-arrays
specialized-arrays.instances.benchmark.struct-arrays.point ;

M: point-array underlying-type drop \ point ;


USING: alien.c-types benchmark.struct-arrays math math.vectors
sequences
specialized-arrays.instances.benchmark.struct-arrays.point ;

M: point-array v*high
[ * \ point heap-size neg shift ] 2map ; inline


USING: alien.c-types benchmark.struct-arrays math math.vectors
sequences
specialized-arrays.instances.benchmark.struct-arrays.point ;

M: point-array vs* [ * \ point c-type-clamp ] 2map ; inline


USING: alien.c-types benchmark.struct-arrays math math.vectors
sequences
specialized-arrays.instances.benchmark.struct-arrays.point ;

M: point-array vs+ [ + \ point c-type-clamp ] 2map ; inline


USING: alien.c-types benchmark.struct-arrays math math.vectors
sequences
specialized-arrays.instances.benchmark.struct-arrays.point ;

M: point-array vs- [ - \ point c-type-clamp ] 2map ; inline