Skip to content

Change type of tsk_tree_t.num_children to tsk_id_t #2333

@jeromekelleher

Description

@jeromekelleher

Following up on recent additions to the tree data model in #2316, I wonder if we've made the right decision on the type for the num_children array.

While tsk_size_t is the "right" type for something that's a count, having an array of 64 bit numbers is unnecessary here because we can't possibly have more children than there are node IDs, and making this array twice as big as it needs to be is a significant memory overhead.

So, for simplicity, perhaps we should make the type of the array tsk_id_t, even though that is somewhat inconsistent with other usages? The other option would be to make it a uint32_t, but that's tricky because we'd have to typedef it in the BIG_TABLES case. We'd only be doing this to make the type unsigned anyway, which doesn't make all that much difference.

I don't think there's a right answer here, and at least making it a tsk_id_t is simple and consistent with the other tree arrays?

cc @benjeffery @GertjanBisschop

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions