Cyclone Scheme
0.28.0
|
◆ alloc_bytevector
Value:
if (_len >= MAX_STACK_OBJ) { \
int heap_grown; \
_bv = gc_alloc(((gc_thread_data *)data)->heap, \
sizeof(bytevector_type) + _len, \
boolean_f, /* OK to populate manually over here */ \
(gc_thread_data *)data, \
&heap_grown); \
((bytevector) _bv)->hdr.mark = ((gc_thread_data *)data)->gc_alloc_color; \
((bytevector) _bv)->hdr.grayed = 0; \
((bytevector) _bv)->hdr.immutable = 0; \
((bytevector) _bv)->tag = bytevector_tag; \
((bytevector) _bv)->len = _len; \
} else { \
_bv = alloca(sizeof(bytevector_type)); \
((bytevector) _bv)->hdr.mark = gc_color_red; \
((bytevector) _bv)->hdr.grayed = 0; \
((bytevector) _bv)->hdr.immutable = 0; \
((bytevector) _bv)->tag = bytevector_tag; \
((bytevector) _bv)->len = _len; \
}
Allocate a new bytevector, either on the stack or heap depending upon size |