If your question is how to dynamically allocate memory in TinyOS, then
the answer is that you can't.  All memory is statically allocated at
compile time.  Of course you could always allocate a big chunk of
memory to some sort of memory allocator component and then implement a
memory allocator yourself, but this sort of goes against the spirit of
TinyOS.

I actually have some table and list components implemented (you have
to set a static maximum size on them though).  I'll look into setting
up a contrib directory for these.  Might be good to have a general
data-structures contrib where people can contribute various data
structure components they have created.  If they prove to be useful
and bug free, they could possibly make their way into the core someday
too.

Kevin

On 9/10/07, Steve McKown <[EMAIL PROTECTED]> wrote:
> On Monday 27 August 2007 04:02:05 am vazoumana fofana wrote:
> > Hello,
> >
> > I ve got an implementation 's question.
> > I want to implement an application where a node loads on its flash a list
> > of its  neighbousr.
> > do you know how can i create a list or a dynamic table in nesc ?
>
> To my knowledge, there is no specific functionality in nesc to support writing
> a list to flash.  This probably doesn't make sense in nesc itself, since it's
> a generic language facility.  There is, however, in tos-2.x a generic Queue
> component.  It manages a list of objects in RAM.  You could then write some
> code to read/write the RAM Queue to flash.  You could also write a wrapper
> component around Queue that provides a Queue interface and a control
> interface to 'freeze' the RAM Queue to flash or 'thaw' the flash Queue image
> back into RAM.
> _______________________________________________
> Tinyos-help mailing list
> [email protected]
> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
>


-- 
~Kevin
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to