Skip to content

Support 32 or 64 bit sizes in offset columns #1530

@jeromekelleher

Description

@jeromekelleher

#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 the read_table_ragged_col_t struct
  • Then, in read_table_ragged_cols if the type of the offset_col is KAS_UINT32, then we allocate the required memory for this column into the offset_array_mem, and update col->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 function free_read_table_memory(cols, ragged_cols, properties);, which will loop through the ragged cols and tsk_safe_free the offset_array_mem. (I think we should include the cols and properties 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

No one assigned

    Labels

    C APIIssue is about the C API

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions