OpenCyphal-Garage / libcyphal

Portable reference implementation of the Cyphal protocol stack in C++ for embedded systems and Linux.
http://opencyphal.org
MIT License
299 stars 501 forks source link

Apply small payload deserialize optimization #391

Closed serges147 closed 3 weeks ago

serges147 commented 3 weeks ago

This case (namely with zero-length payload) was discovered during my work with the demo app, where I deliberately use special (O1Heap-based) PMR allocator for ALL dynamic allocations. It turns out that such allocator has special/corner case when payload is empty (which is a totally valid case, f.e. for an RPC service request). So, investigation of this problem also brought attention to quite useful optimization we can have during deserialization.

sonarcloud[bot] commented 3 weeks ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
100.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud