Exemplo n.º 1
0
int
main(int argc, char *argv[])
{
	unsigned int r, size;

	common_srand48((long int)time(NULL));
	if (argc < 2) {
		ck_error("Usage: ck_hs <dictionary> [<repetitions> <initial size>]\n");
	}

	r = 16;
	if (argc >= 3)
		r = atoi(argv[2]);

	size = 8;
	if (argc >= 4)
		size = atoi(argv[3]);

	global_seed = common_lrand48();
	run_test(argv[1], r, size, 0);
	run_test(argv[1], r, size, CK_HS_MODE_DELETE);
	fprintf(stderr, "#    reverse_insertion serial_insertion random_insertion serial_swap "
	    "serial_replace reverse_get serial_get random_get serial_remove negative_get tombstone "
	    "set_unique gc rebuild\n\n");

	return 0;
}
Exemplo n.º 2
0
static void
table_init(void)
{

	common_srand48((long int)time(NULL));
	if (ck_ht_init(&ht, CK_HT_MODE_BYTESTRING, NULL, &my_allocator, 8, common_lrand48()) == false) {
		perror("ck_ht_init");
		exit(EXIT_FAILURE);
	}

	return;
}
Exemplo n.º 3
0
static void
set_init(void)
{

	common_srand48((long int)time(NULL));
	if (ck_hs_init(&hs, CK_HS_MODE_OBJECT | CK_HS_MODE_SPMC, hs_hash, hs_compare, &my_allocator, 8, common_lrand48()) == false) {
		perror("ck_hs_init");
		exit(EXIT_FAILURE);
	}

	return;
}