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


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]