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
If I serialize an int on a 64 bit machine, an deserialize the tpl on a machine whose ints are 32 bits, what would happen ?
Another related question: if I serialize an int whose value is 5 on the 64 bit machine, does the tpl image allocates 8 bytes for it (plus any metadata it needs) or does it optimize it (e.g. by allocating only 1 byte). I'm asking this because we have big size restrictions on our embedded system.
Thanks
The text was updated successfully, but these errors were encountered:
On Jun 19, 2019, at 2:18 AM, DexterMagnific ***@***.***> wrote:
Dear developer,
If I serialize an int on a 64 bit machine, an deserialize the tpl on a machine whose ints are 32 bits, what would happen ?
This is why tpl has different format characters for each size of int (i and I, u and U, etc). When you unpack, the same character has to be used in the format string, that was used to pack it. So a U can only get unpacked to a U (64 bit) and so on.
I recommend using int32_t and other explicit sized types in programs that serialize or unserialize just to keep things very clear.
Another related question: if I serialize an int whose value is 5 on the 64 bit machine, does the tpl image allocates 8 bytes for it (plus any metadata it needs) or does it optimize it (e.g. by allocating only 1 byte). I'm asking this because we have big size restrictions on our embedded system.
Dear developer,
If I serialize an int on a 64 bit machine, an deserialize the tpl on a machine whose ints are 32 bits, what would happen ?
Another related question: if I serialize an int whose value is 5 on the 64 bit machine, does the tpl image allocates 8 bytes for it (plus any metadata it needs) or does it optimize it (e.g. by allocating only 1 byte). I'm asking this because we have big size restrictions on our embedded system.
Thanks
The text was updated successfully, but these errors were encountered: