Пример #1
0
int main(void) {
  xrational_t *a;

  init_rationals();
  a = (xrational_t *) safe_malloc(150 * sizeof(xrational_t));
  init_test_array(a, 150);

  printf("Init: size 1\n");
  init_xq_hmap(&map, 1);
  print_hmap(&map);


  test1(&map, a, 150);

  printf("Reset\n");
  reset_xq_hmap(&map);
  print_hmap(&map);

  test1(&map, a, 150);

  delete_xq_hmap(&map);

  free_test_array(a, 150);
  cleanup_rationals();

  return 0;
}
Пример #2
0
static void
sync_product(dfa_t *pout, dfa_t *pleft, dfa_t *pright)
{
  pout->last_index = 0;

  if (dfa_verbose > 2) {
    fprintf(stderr, "Product between %s and %s\n", pleft->name, pright->name);
    fprintf(stderr, "result in %s\n", pout->name);
  }


  gpout = pout;
  gpleft = pleft;
  gpright = pright;
  new_test_array(&gtest);
  add_to_test_array(&gtest, 1, 1, 1);
  pout->last_state = 1;

  do_sync_product(1, 1);

  free_test_array(&gtest);
}
Пример #3
0
int main(int argc, char const *argv[])
{
	int a;
	wt_array *array = wt_array_init(100000);

	for(int i = 0 ; i < 100000 ; i++){
		test* t = malloc (sizeof(test));
		wt_array_add(array,t);
	}

	scanf("%d",&a);
	free_test_array(array);
	scanf("%d",&a);
	//printf("free:\n");
	//system("pause");
	//wt_array_free(&array);
	//printf("freed:\n");

	//test* t = (test*) malloc (sizeof(test) * 1000000);
	//memset(t,0,sizeof(test) * 1000000);
	//scanf("%d",&a);
	//free(t);
	//scanf("%d",&a);
}