]> gitweb.factorcode.org Git - factor.git/blob - vm/byte_arrays.hpp
Merge branch 'master' of /Users/slava/factor/
[factor.git] / vm / byte_arrays.hpp
1 namespace factor
2 {
3
4 byte_array *allot_byte_array(cell size);
5
6 PRIMITIVE(byte_array);
7 PRIMITIVE(uninitialized_byte_array);
8 PRIMITIVE(resize_byte_array);
9
10 struct growable_byte_array {
11         cell count;
12         gc_root<byte_array> elements;
13
14         growable_byte_array(cell capacity = 40) : count(0), elements(allot_byte_array(capacity)) { }
15
16         void append_bytes(void *elts, cell len);
17         void append_byte_array(cell elts);
18
19         void trim();
20 };
21
22 }