2 ms·
The purpose of zero-copy can be to avoid deserialization at all. All you do to deserialize is: uint8_t *buf = ...; struct example_payload *payload = (struct ex
by iscoelho 2y ago
The purpose of zero-copy can be to avoid deserialization at all. All you do to deserialize is:
uint8_t *buf = ...; struct example_payload *payload = (struct example_payload *) buf;
That's why when you access the variables you need to byte order swap. This is absolutely not portable, I agree. I also agree that it is error-prone. However, it is the reality of a lot of performance critical software.