tried adding writing of garbage data at head of file to appease dr memory
@@ -34,6 +34,7 @@ linear_hash_init(
/* open datafile */
linear_hash->database = fopen(data_filename, "w+b");
+ fwrite(&(int) { 0xADDE }, sizeof(int), 1, linear_hash->database);
/* initialize linear_hash fields */
linear_hash->initial_size = initial_size;
@@ -649,7 +650,7 @@ write_new_bucket(
/* seek to end of file to append new bucket */
ion_fpos_t bucket_loc;
- ion_fpos_t record_total_size = linear_hash->super.record.key_size + linear_hash->super.record.value_size + sizeof(ion_byte_t);
+// ion_fpos_t record_total_size = linear_hash->super.record.key_size + linear_hash->super.record.value_size + sizeof(ion_byte_t);
if (idx == 0) {
fseek(linear_hash->database, 0, SEEK_SET);
@@ -686,6 +687,7 @@ linear_hash_get_bucket(
ion_fpos_t bucket_loc,
linear_hash_table_t *linear_hash
) {
+ fseek(linear_hash->database, 0, SEEK_END);
/* create a temporary store for records that are read */
linear_hash_bucket_t bucket;
