This commit is contained in:
Nikolaj
2021-10-04 15:13:57 +02:00
parent 740d8bc1e0
commit 3f3346d22c
5 changed files with 5 additions and 8 deletions

View File

@ -33,6 +33,9 @@ int id_query_loop(int argc, char** argv, mk_index_fn mk_index, free_index_fn fre
uint64_t runtime_sum = 0;
while (getline(&line, &line_len, stdin) != -1) {
if (line[0] == '\n') {
break;
}
int64_t needle = atol(line);
start = microseconds();

Binary file not shown.

View File

@ -33,13 +33,7 @@ struct indexed_data* mk_indexed(struct record* rs, int n) {
}
void free_indexed(struct indexed_data* data) {
struct record* rs = malloc(sizeof(struct record*));
int n = data->n;
for (int i = 0 ; i < n ; i++) {
struct index_record* irec = &data->irs[i];
rs[i] = *irec->record;
}
free_records(rs, n);
free(data);
}
const struct record* lookup_indexed(struct indexed_data *data, int64_t needle) {

Binary file not shown.

View File

@ -23,7 +23,7 @@ struct naive_data* mk_naive(struct record* rs, int n) {
}
void free_naive(struct naive_data* data) {
free_records(data->rs,data->n);
free(data);
}
const struct record* lookup_naive(struct naive_data *data, int64_t needle) {