version 1.1.2.1, 2011/04/19 21:07:32
|
version 1.1.2.2, 2011/04/19 22:00:44
|
Line 123 io_arrayGrow(array_t * __restrict arr, int newNumItems
|
Line 123 io_arrayGrow(array_t * __restrict arr, int newNumItems
|
free(arr->arr_data[i]); |
free(arr->arr_data[i]); |
*/ |
*/ |
|
|
|
arr->arr_num = newNumItems; |
data = realloc(arr->arr_data, arr->arr_num * sizeof(void*)); |
data = realloc(arr->arr_data, arr->arr_num * sizeof(void*)); |
if (!data) { |
if (!data) { |
LOGERR; |
LOGERR; |
return -1; |
return -1; |
} else |
} else |
arr->arr_data = data; |
arr->arr_data = data; |
memset(arr->arr_data + arr->arr_num, 0, n * sizeof(void*)); | memset(arr->arr_data + (arr->arr_num - n), 0, n * sizeof(void*)); |
arr->arr_num = newNumItems; | |
|
|
return 0; |
return 0; |
} |
} |