ListData* allocate_empty_list(int capacity) { ListData* result = (ListData*) malloc(sizeof(ListData) + capacity * sizeof(caValue)); debug_register_valid_object(result, LIST_OBJECT); result->refCount = 1; result->count = 0; result->capacity = capacity; result->immutable = false; memset(result->items, 0, capacity * sizeof(caValue)); for (int i=0; i < capacity; i++) initialize_null(&result->items[i]); return result; }
Term::Term() : weakPtr(0), type(NULL), function(NULL), nameSymbol(name_None), owningBranch(NULL), index(0), nestedContents(NULL), flags(0) { id = gNextGlobalID++; debug_register_valid_object(this, TERM_OBJECT); if (id == DEBUG_BREAK_ON_TERM) ca_debugger_break(); }