예제 #1
0
파일: list.cpp 프로젝트: RickMoynihan/circa
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;
}
예제 #2
0
파일: term.cpp 프로젝트: levelplane/circa
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();
}