Skip to content

Solving the problem of excessive space usage by boolean arrays #1

@xaxys

Description

@xaxys

We have a structure like this

struct RovExdataLeakageData[6] {
    bool<48> leakage [order="big"];
}

It contains 48 bool bit to indicate where each sensor detects leackage or not.

However, it will be translated as below

// Struct: RovExdataLeakageData [6] {1 fields}
struct RovExdataLeakageData {
    // [0, 6) NormalField: bool<48> leakage[6]
    bool leakage[48];
};

This structure will take up to 48 Byte space in memory, which is unacceptable for embedded device.

Could we figure out a solution to reduce the consumption of memory?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions