summaryrefslogtreecommitdiffstats
path: root/file.c
diff options
context:
space:
mode:
authorGravatar Linus Torvalds <torvalds@linux-foundation.org>2012-11-23 16:05:38 -1000
committerGravatar Dirk Hohndel <dirk@hohndel.org>2012-11-23 19:33:39 -0800
commita9786564c23fbf032f47096f543699c8c402785b (patch)
tree551231e54e017c9e83fd44da59edbe4c94dfa716 /file.c
parent10ce60e2120419282ff7694e8deda60e94832aa1 (diff)
downloadsubsurface-a9786564c23fbf032f47096f543699c8c402785b.tar.gz
Allocate dive samples separately from 'struct dive'
We used to avoid some extra allocations by just allocating the dive samples as part of the 'struct dive' allocation itself, but that ends up complicating things, and will make it impossible to have multiple different sets of samples (for multiple dive computers). So stop doing it. Just allocate the dive samples array separately. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'file.c')
-rw-r--r--file.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/file.c b/file.c
index 31f5d882c..1289f3436 100644
--- a/file.c
+++ b/file.c
@@ -204,7 +204,7 @@ static int try_to_open_csv(const char *filename, struct memblock *mem, enum csv_
if (errno)
break;
- sample = prepare_sample(&dive);
+ sample = prepare_sample(dive);
sample->time.seconds = time;
add_sample_data(sample, type, val);
finish_sample(dive);