This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: problem with memory allcoation
- From: Andrew Lunn <andrew dot lunn at ascom dot ch>
- To: Mayank Sharma <mayanks at mindtree dot com>
- Cc: eCos Disuss <ecos-discuss at sources dot redhat dot com>
- Date: Tue, 6 Aug 2002 12:32:05 +0200
- Subject: Re: [ECOS] problem with memory allcoation
- References: <E125980C421DFD4DA0B80D55DB1EDA58BC5CC8@mtv01ex01.mindtree.com>
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