This is the mail archive of the
ecos-discuss@sourceware.org
mailing list for the eCos project.
Re: Query about dynamic memory allocation
- From: Gary Thomas <gary at mlbassoc dot com>
- To: imran khan <imran dot eie dot 85 at gmail dot com>
- Cc: eCos Discussion <ecos-discuss at ecos dot sourceware dot org>
- Date: Wed, 16 Aug 2006 05:01:26 -0600
- Subject: [ECOS] Re: Query about dynamic memory allocation
- References: <9fd2524e0608160217t29c8fe40t46ff9d50d4d8237a@mail.gmail.com> <9fd2524e0608160224g15099746k59fa0a1b536cb4a9@mail.gmail.com>
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