factor/vm/byte_arrays.hpp

19 lines
415 B
C++
Raw Normal View History

2009-05-02 05:04:19 -04:00
F_BYTE_ARRAY *allot_byte_array(CELL size);
PRIMITIVE(byte_array);
PRIMITIVE(uninitialized_byte_array);
PRIMITIVE(resize_byte_array);
2009-05-02 05:04:19 -04:00
/* Macros to simulate a byte vector in C */
2009-05-02 10:19:09 -04:00
struct growable_byte_array {
2009-05-02 05:04:19 -04:00
CELL count;
2009-05-02 10:19:09 -04:00
gc_root<F_BYTE_ARRAY> array;
2009-05-02 05:04:19 -04:00
2009-05-02 10:19:09 -04:00
growable_byte_array() : count(0), array(allot_byte_array(2)) { }
2009-05-02 05:04:19 -04:00
2009-05-02 10:19:09 -04:00
void append_bytes(void *elts, CELL len);
void append_byte_array(CELL elts);
2009-05-02 05:04:19 -04:00
2009-05-02 10:19:09 -04:00
void trim();
};