This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

udp_get_buf() memory allocation

Greetings:

Has anyone any information where function udp_get_buf() allocates memory from and, on the other side of the equation, how the memory is freed?

We are using TCP and UDP functions stand alone. TCP appears to be working fine, but UDP sending is proving erratic.

I would expect dynamic memory allocation such as implied in udp_get_buf() to require heap space, which we do not currently specify in this application. Mistake?

Per examples cited in the RTL documentation, function udp_get_buf() returns a pointer to memory. This memory is then loaded with the UDP message and passed to function udp_send(). I would hope some code somewhere in the library has marked the buffer as used. Do I have responsibility of freeing it?

Thanks for your thoughts,
Doug

Parents
  • "Mistake?"

    The size of the TCPnet heap is specified with the Memory Pool Size in NET_Config.C

    "Do I have responsibility of freeing it?"

    No - You need to allocate a buffer with udp_get_buf() so you can fill it with what you send via udp_send(). When TCPnet sends it, the buffer is released by 'it' (i.e., not you).

    At least ... that's how I understand it.

Reply
  • "Mistake?"

    The size of the TCPnet heap is specified with the Memory Pool Size in NET_Config.C

    "Do I have responsibility of freeing it?"

    No - You need to allocate a buffer with udp_get_buf() so you can fill it with what you send via udp_send(). When TCPnet sends it, the buffer is released by 'it' (i.e., not you).

    At least ... that's how I understand it.

Children
No data