[ECOS] Re: Query about dynamic memory allocation

Gary Thomas gary@mlbassoc.com
Wed Aug 16 11:01:00 GMT 2006


imran khan wrote:
> 
> 
> 
> 
> Sir,
>   I am trying to allocate stack for a thread dynamically before making 
> call to cyg_thread_create() for creating the thread
>   but malloc is not working for 500 or more no. of bytes and the machine 
> gets hanged whenever malloc () is called.
>  I have tried changing the main STACK_SIZE with no luck.
>  I m working on synthetic target at present . I even tried with 
> mallinfo() call.
>  I made mallinfo() call before making a call to malloc() and it showed 
> 3356480 as the value of "mallinfo.maxfree"and
> even after calling mallinfo() after making a call to malloc() it showed 
> the same value of mallinfo.maxfree.
> So where from malloc() is allocating memory and how can I make malloc() 
> work properly for my purpose which I have mentioned at the start of the 
> mail.
> Plz, help me out of this problem.

First of all, if you need help with eCos, ask on the mailing list.
There are many folks there that can help and everyone benefits from
the discussion.  Private assistance is only available with a support
contract.

Now, to your problem.  You've not provided any real information on
what's going wrong other than it's not working.  Before I (or anyone)
can help, there are many pieces of data required:
   * How did you configure eCos?
   * Have you run any programs?  especially the tests?
   * Your program seems simple enough - maybe you can just share it?

-- 
------------------------------------------------------------
Gary Thomas                 |  Consulting for the
MLB Associates              |    Embedded world
------------------------------------------------------------

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



More information about the Ecos-discuss mailing list