514 } |
514 } |
515 |
515 |
516 list->base.cl = &cx_array_list_class; |
516 list->base.cl = &cx_array_list_class; |
517 list->base.allocator = allocator; |
517 list->base.allocator = allocator; |
518 list->base.cmpfunc = comparator; |
518 list->base.cmpfunc = comparator; |
519 list->base.itemsize = item_size; |
|
520 list->base.capacity = initial_capacity; |
519 list->base.capacity = initial_capacity; |
|
520 |
|
521 if (item_size > 0) { |
|
522 list->base.itemsize = item_size; |
|
523 } else { |
|
524 cxListStorePointers((CxList *) list); |
|
525 } |
521 |
526 |
522 // configure the reallocator |
527 // configure the reallocator |
523 list->reallocator.realloc = cx_arl_realloc; |
528 list->reallocator.realloc = cx_arl_realloc; |
524 list->reallocator.ptr1 = (void *) allocator; |
529 list->reallocator.ptr1 = (void *) allocator; |
525 |
530 |