deps/kb_meme/meme-5.0.1/src/array-list.c
/*
 * arraylst_fit
 * Ensures that the allocated size is exactly the currently
 * utilized size. If arraylst_preallocate has been called
 * then this cancels its requirement.
 */
arraylst_fit
Ensures that the allocated size is exactly the currently
utilized size. If arraylst_preallocate has been called
then this cancels its requirement.
arraylst_fit Ensures that the allocated size is exactly the currently utilized size . If arraylst_preallocate has been called then this cancels its requirement .
void arraylst_fit(ARRAYLST_T *arraylst) {
  if (arraylst == NULL) die("arraylst_fit: arraylst is null!\n");
  arraylst->min_alloc = 0;
  if (arraylst->cur_alloc > arraylst->size) {
    if (arraylst->size == 0) {
      free(arraylst->array);
    } else {
      arraylst->array = (void**)mm_realloc(arraylst->array, sizeof(void*)*arraylst->size);
    }
    arraylst->cur_alloc = arraylst->size;
  }
}
void arraylst_fit ( ARRAYLST_T * arraylst ) { if ( arraylst == NULL ) die ( " \n " ) ; arraylst -> min_alloc = 0 ; if ( arraylst -> cur_alloc > arraylst -> size ) { if ( arraylst -> size == 0 ) { free ( arraylst -> array ) ; } else { arraylst -> array = ( void * * ) mm_realloc ( arraylst -> array , sizeof ( void * ) * arraylst -> size ) ; } arraylst -> cur_alloc = arraylst -> size ; } }
arraylst_fit
 Ensures that the allocated size is exactly the currently
 utilized size.
arraylst_fit Ensures that the allocated size is exactly the currently utilized size .
//test parameters