Originally posted by **ThibFrgsGmz** September 23, 2022
Hi,
Please correct me if I have misunderstood the way to use `ASN.1`.
To serialize a message according to a `uPER`/`ACN` encoding protocol, you have to
- define a `C structure` of the message,
- fill it with good values,
- pass it to the encoding function to have a serialized message in the `BitStream` object.
This `C structure` of the message would be allocated at compile time in the `BSS` section (or on the `stack` like your unit tests but there is a big risk of stack overflow).
So I'm interested in the memory footprint of the structure and what I see worries me.
I see that my `U8`/`I8`/`U16`/`I16` types are in fact `asn1SccUint`/`asn1SccSint` which are `64 bits` or `32 bits` depending on whether `WORD_SIZE` is `8`.
Note: same story for `F32` floats.
Could you tell me the reason why the members of `C structures` are `32/64 bits`?
Isn't there a way to reduce their memory footprint? I mean, a `U8` is an `unsigned char`, a `U16` an `unsigned short`, etc.
Discussed in https://github.com/ttsiodras/asn1scc/discussions/246