<commit_before>! Copyright (C) 2009 <NAME>.
! See http://factorcode.org/license.txt for BSD license.
USING: accessors byte-arrays growable kernel math sequences
sequences.private struct-arrays ;
IN: struct-vectors

TUPLE: struct-vector
{ underlying struct-array }
{ length array-capacity }
{ c-type read-only } ;

: <struct-vector> ( capacity c-type -- struct-vector )
    [ <struct-array> 0 ] keep struct-vector boa ; inline

M: struct-vector new-sequence
    [ c-type>> <struct-array> ] [ [ >fixnum ] [ c-type>> ] bi* ] 2bi
    struct-vector boa ;

M: struct-vector contract 2drop ;

M: struct-array new-resizable c-type>> <struct-vector> ;

INSTANCE: struct-vector growable<commit_msg>byte-length for struct-vectors<commit_after>! Copyright (C) 2009 <NAME>.
! See http://factorcode.org/license.txt for BSD license.
USING: accessors byte-arrays growable kernel math sequences
sequences.private struct-arrays ;
IN: struct-vectors

TUPLE: struct-vector
{ underlying struct-array }
{ length array-capacity }
{ c-type read-only } ;

: <struct-vector> ( capacity c-type -- struct-vector )
    [ <struct-array> 0 ] keep struct-vector boa ; inline

M: struct-vector byte-length underlying>> byte-length ;
M: struct-vector new-sequence
    [ c-type>> <struct-array> ] [ [ >fixnum ] [ c-type>> ] bi* ] 2bi
    struct-vector boa ;

M: struct-vector contract 2drop ;

M: struct-array new-resizable c-type>> <struct-vector> ;

INSTANCE: struct-vector growable
{'fraction_non_alphanumeric': 0.13457556935817805, 'fraction_numerical': 0.00966183574879227, 'mean_word_length': 3.8986486486486487, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3736564', 'n_tokens_mistral': 485, 'n_tokens_neox': 463, 'n_words': 130}