Menu

#42 Usage of memcmp() in the trdp_pdReceive() function

1.2.0.0
closed
None
2014-06-02
2014-06-02
Gari
No

informUser = memcmp(pNewFrame->data, pExistingElement->pFrame->data, pExistingElement->dataSize); (Function trdp_pdReceive())

In all the cases that the received PD packets match with one of the subscripted packets, it is checked if the data has been changed (informUser). If this is the case, then the packet pointers will be swapped and the application will be informed if the flag “TRDP_FLAGS_CALLBACK” is provided.

The behavior of the library will be better if the pointers are swapped in all the cases, and memcmp() is called only in that cases that the flag “TRDP_FLAGS_CALLBACK” is enabled. This way, the total CPU load is decremented notably, because the swapping of the pointers consumes less CPU load than the memcp() call. (See the attached file trdp_pdcom.c)

1 Attachments

Discussion

  • Bernd Löhr

    Bernd Löhr - 2014-06-02
    • status: open --> accepted
    • assigned_to: Gari --> Bernd Löhr
     
  • Bernd Löhr

    Bernd Löhr - 2014-06-02

    Code area also touches Issue#41, so I'd like to fix it ;-)

     
  • Bernd Löhr

    Bernd Löhr - 2014-06-02
    • status: accepted --> closed
     
  • Bernd Löhr

    Bernd Löhr - 2014-06-02

    Fixed in Rev 1222

     

Log in to post a comment.

MongoDB Logo MongoDB