-
Notifications
You must be signed in to change notification settings - Fork 77
Closed
Labels
C APIIssue is about the C APIIssue is about the C API
Milestone
Description
#1529 added some infrastructure abstract out reading and writing offset columns. Here's how I think we can build on this to allow us to support either 32 bit or 64 bit sizes for the offset column (see #1527) in the file format:
- add a new field
tsk_size_t * offset_array_mem
to theread_table_ragged_col_t
struct - Then, in
read_table_ragged_cols
if the type of the offset_col isKAS_UINT32
, then we allocate the required memory for this column into the offset_array_mem, and updatecol->offset_array_dest
to point to this memory. We then loop through the array of 32 bit values from the kastore, and cast them into the newly allocated array. - As part of the
out
block in (.e.g)tsk_individual_table_load
we call a new functionfree_read_table_memory(cols, ragged_cols, properties);
, which will loop through the ragged cols and tsk_safe_free theoffset_array_mem
. (I think we should include thecols
andproperties
here while we're at it, because we may do something similar for them soon.) - We'll probably have to update the struct initialisers read_table_ragged_col_t to set
offset_array_mem
to NULL; either that or we change to using named initialsers (like.name="individuals/location"
, etc) which I think guarantee that anything that's not explicity assigned is set to zero.
What do you think @benjeffery?
Metadata
Metadata
Assignees
Labels
C APIIssue is about the C APIIssue is about the C API