This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: stack usage


Uttered Aravind B <arvindb@cranessoftware.com>, spake thus:

> First thread gives 100 
> second,third and fourth threads gives 80 .
> 
> My problem is in the third thread i have defined short variable.
> Inspite of it is giving value 80 as 2 and 4 thread.
> 
> 2 and 4 thread  is defined as
> 
> void procedureB(cyg_addrword_t data)
> {
> 	printf("ThreadB %d\n",cyg_thread_measure_stack_usage( handleB));
> }
> 

Why not show us the 3 thread that is giving showing the problem?

I suspect that the compiler just allocated your short variable into a
CPU register and not on the stack.  Try using an "int foo[32]" array
instead.

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]