[Tinyos-devel] ENOMEM in TinyError.h

Matt Welsh mdw at eecs.harvard.edu
Tue May 6 09:08:32 PDT 2008


Anything that does dynamic resource allocation. There are various  
implementations of dynamic memory management for TinyOS where this  
would be useful. TinyOS might have a policy of static allocation for  
most things, but there are plenty of situations -- memory pool  
management, thread creation, packet queues, energy scheduling -- where  
an ENORESOURCE would be useful. I think it makes sense to at least  
have an error code that represents the case of a dynamic resource  
allocation request was denied.


On May 6, 2008, at 12:03 PM, Philip Levis wrote:
>
> On May 6, 2008, at 8:40 AM, Matt Welsh wrote:
>> An interface that attempts to allocate memory and is unable to do  
>> so. This is consistent with UNIX semantics and would be familiar to  
>> many programmers.
>>
>> ESIZE is not the same thing. The description is "the parameter  
>> passed is too big". That could be because the interface does not  
>> support values as large as the parameter value, which is different  
>> than being currently unable to perform a memory allocation that  
>> would otherwise have succeeded.
>>
>> More generally this could be captured with an ENORESOURCE which  
>> says that the resources required to process the request -- whatever  
>> they are -- are not available. ESIZE is not really appropriate  
>> since it might have nothing to do with any parameter passed to the  
>> interface.
>
> Right: I guess my inquiry came from the question, given TinyOS's  
> static allocation policy and pass semantics for buffers, whether  
> ENOMEM makes sense. What interface would need it?
>
> Phil
>



More information about the Tinyos-devel mailing list