![]() |
Cyclone Scheme
0.9
|
Value:
if (_len >= MAX_STACK_OBJ) { \ int heap_grown; \ _s = gc_alloc(((gc_thread_data *)data)->heap, \ sizeof(string_type) + _len + 1, \ boolean_f, /* OK to populate manually over here */ \ (gc_thread_data *)data, \ &heap_grown); \ ((string_type *) _s)->hdr.mark = ((gc_thread_data *)data)->gc_alloc_color; \ ((string_type *) _s)->hdr.grayed = 0; \ ((string_type *) _s)->tag = string_tag; \ ((string_type *) _s)->len = _len; \ ((string_type *) _s)->num_cp = _num_cp; \ } else { \ _s = alloca(sizeof(string_type)); \ ((string_type *)_s)->hdr.mark = gc_color_red; \ ((string_type *)_s)->hdr.grayed = 0; \ ((string_type *)_s)->tag = string_tag; \ ((string_type *)_s)->len = _len; \ ((string_type *)_s)->num_cp = _num_cp; \ } Definition: types.h:290 Definition: types.h:56 void * gc_alloc(gc_heap_root *h, size_t size, char *obj, gc_thread_data *thd, int *heap_grown) Allocate memory on the heap for an object. Definition: gc.c:1319 Allocate a new string, either on the stack or heap depending upon size |