3 struct growable_byte_array {
5 data_root<byte_array> elements;
8 growable_byte_array(factor_vm* parent, cell capacity = 40)
9 : count(0), elements(parent->allot_byte_array(capacity), parent) {}
11 void reallot_array(cell count);
12 void grow_bytes(cell len);
13 void append_bytes(void* elts, cell len);
14 void append_byte_array(cell elts);
20 template <typename Type>
21 byte_array* factor_vm::byte_array_from_value(Type* value) {
22 byte_array* data = allot_uninitialized_array<byte_array>(sizeof(Type));
23 memcpy(data->data<char>(), value, sizeof(Type));