I would like to send custom messages via the mailbox utility. It looks like mailBox_read copies the next message into the pointer location. However, since my messages could be of different sizes, how can I make sure that if the next message is larger than the memory pointed to, I will not clobber good memory?
One suggestion would be to have a routine mailBox_query_message_size that returns the size of the next message but does not free the node and does not copy the body of the message.
Is this how I should implement it?