You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Any way to limit the size in the generated structure? It seems wasteful to generate a uint32_t for something we know will not be decoded if it's not within size uint8_t.
I get that the decoder may try and use this memory and the default int type of cbor can use all 32bits. But, wouldn't this be rather easy to handle if the decoding step went to a temporary first and was stored into the smaller type if it met the conditions?
The text was updated successfully, but these errors were encountered:
Perhaps even more egregious in terms of memory usage is this for optional ? values
CDDL: ?bool_value : "b" => bool,
Generated header:
struct header_bstr_bool_value bool_value; // Structure that defines with a single bool member
uint_fast32_t bool_value_present; // Bool used elsewhere, but an obvious case for one is uint32?
Confirmed, there are bools for present. As to the others, I'm not in a hurry, it would just be a nice change to see uint8_t over uint32_t for something that can only store a few options.
In my cddl:
"d" => uint 0..100
Later in the generated types.h:
uint32_t d;
Any way to limit the size in the generated structure? It seems wasteful to generate a uint32_t for something we know will not be decoded if it's not within size uint8_t.
I get that the decoder may try and use this memory and the default int type of cbor can use all 32bits. But, wouldn't this be rather easy to handle if the decoding step went to a temporary first and was stored into the smaller type if it met the conditions?
The text was updated successfully, but these errors were encountered: