Hi everyone,
I am still working with BLIP and found a piece of code that made me
wonder if it could cause memory problems.
In the file <IPDispatchP.nc> is the interface command <IPLower.send>
that splits ip packets to fragments and enqueues these.
It starts by allocating a send_info and after this it allocates for
every fragment split both a send_entry and a message_t (from FragPool).
In all failure cases send_entry and message_t are put back to their
pools but when failing to enqueue them in SendQueue they aren't put back.
Since sendTask() only drops and 'put back's the fragments already
enqueued in SendQueue, we would loose a SendEntryPool-entry and a
FragPool-entry forever...
Some code to show what I meant:
struct send_info *s_info = getSendInfo();
while(BYTESLEFTTOSEND < BYTESPUTINFRAGMENTS) {
struct send_entry *s_entry = call SendEntryPool.get();
message_t *outgoing = call FragPool.get();
if (call SendQueue.enqueue(s_entry) != SUCCESS) {
s_info->failed = TRUE;
// Shouldn't they be put back?
// FragPool.put(outgoing);
// SendEntryPool.put()
}
}
Is this correct or did I do a mistake by ignoring something?
Best regards,
Jonas
P.S.: I have already sent this mail to the moderated devel-list but
since I don't know if the moderation is done frequently, I sent it here,
too.
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help