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: problem with memory allcoation


Thanx a lot Andrew, it's working. the memory allocated to the function stack
was 1K , i thought that much should be enough now i made 4K ( and also
increased the pool size) and it is working. 
But i was not calling any function in subsequent instructions not even
printf's and from the current stack size i could see that i was not using the
whole of 1K so i thought that should'nt be the problem, but after you pointed
it out i increased the size and it worked.

Thanx again Andrew, and thanx to others as well who responded.

Rgds,
Mayank

> -----Original Message-----
> From: Andrew Lunn [mailto:andrew.lunn@ascom.ch]
> Sent: Tuesday, August 06, 2002 4:02 PM
> To: Mayank Sharma
> Cc: eCos Disuss
> Subject: Re: [ECOS] problem with memory allcoation
> 
> 
> On Tue, Aug 06, 2002 at 03:53:19PM +0530, Mayank Sharma wrote:
> > >There could be something going on with alignment. When you allocate
> > >the stack memory, do you align the address before passing it to
> > >cyg_thread_create?
> > 
> > from gdb it looks like the stack is word alligned (word = 4 
> bytes) resultant
> > memory allocation are divisible by 4.
> 
> Thats not enough detail. Some platforms make it 32 byte aligned. Im
> wondering if in the process of aligning the stack, its gone outside of
> the space thats been allocated to it.
> 
> Another thought is that size of the stack. Your memory pool is 4K. How
> big a stack are you allocation? Functions like printf need a big
> stack, so its possible if you have used printf, its exceeded the space
> allocated.
> 
>         Andrew
> 

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


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