I believed...
I'm using TinyOS 2.0.
I tried to compile and use these statements in my code:
int *x;
x=(int *)(malloc(sizeof(int)));
*x=4;
dbg(BlinkC, Timer 0 fired @ %s.\nContenuto di x = %d\n,
sim_time_string(), *x);
and all works well!
So...why using malloc() is dangerous? (as I
Hi,
Malloc might work in a simulation environment, but it does not work on
the physical motes. So if you want to program real hardware you'll have
to find a way to avoid malloc.
Cheers,
Urs
AIGroup wrote:
I believed...
I'm using TinyOS 2.0.
I tried to compile and use these statements in
On Jan 29, 2008, at 2:49 AM, AIGroup wrote:
I believed...
I'm using TinyOS 2.0.
I tried to compile and use these statements in my code:
int *x;
x=(int *)(malloc(sizeof(int)));
*x=4;
dbg(BlinkC, Timer 0 fired @ %s.\nContenuto di x = %d\n,
sim_time_string(), *x);
and all
Malloc actually should work on the mote hardware if you want to try
it. Whiel its use is discouraged, there is technically nothing
preventing you from using it.
Kevin
On Jan 29, 2008 3:52 AM, Urs Hunkeler [EMAIL PROTECTED] wrote:
Hi,
Malloc might work in a simulation environment, but it does
Perhaps you should use the PoolC component which provides similar
functionalities but is safer. It works with pre-allocation.
~Dimas~
2008/1/29, Philip Levis [EMAIL PROTECTED]:
On Jan 29, 2008, at 2:49 AM, AIGroup wrote:
I believed...
I'm using TinyOS 2.0.
I tried to compile and use
On Jan 29, 2008 11:36 AM, Philip Levis [EMAIL PROTECTED] wrote:
On Jan 29, 2008, at 2:49 AM, AIGroup wrote:
I believed...
I'm using TinyOS 2.0.
I tried to compile and use these statements in my code:
int *x;
x=(int *)(malloc(sizeof(int)));
*x=4;
dbg(BlinkC, Timer 0