Hi all
I would like to know how to discard a message which is stored in a queue
(component QueueC of message_t). To better explain this, lets suppose we have a
maximum number of retries during we are trying to forward a data message. This
is stored in a queue waiting for being transmitted. A failed transmission can
occur due to collisions, interferences, etc. So when this maximum number is
reached, the data message should be discarded, making this same procedure with
the following message (head of the queue). Here there is a simple code of what
I'm asking:
maximum_retries = 3;num_retries = 0;
if (num_retries > maximum_retries){ message_t * drop_msg = call
Queue.dequeue(); drop(drop_msg);}
The point is that I'm not sure if just dequeuing the message_t is enough. This
message occupies a piece of memory space and this has to be freed. Am I right?
Should I use the function free as in any C-based language when dynamic memory
allocation is used?
Thanks
David _______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help