This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
problem with memory allcoation
- From: "Mayank Sharma" <mayanks at mindtree dot com>
- To: <ecos-discuss at sources dot redhat dot com>
- Date: Tue, 6 Aug 2002 15:21:49 +0530
- Subject: [ECOS] problem with memory allcoation
Hi Listers,
I am facing a peculiar problem with respent to allocating memory. I
am creating a memory pool using the following code
> static cyg_mempool_var memobj;
> static cyg_uint8 mem[4096];
> cyg_mempool_var_create(mem, 4096, &(rtosPool.memHandle), &memobj);
Then i start a thread (allocate the stack memory from the above
pool). In the thread i am allocating memory to a variable. the contents of
that variable are getting corrupted the moment i assign it a value. for
example if i do
*a = 10;
then 1 or 2 instruction later when i see the value of *a, it
is some corrupted data. I have no clue what is happening, who is accessing
the contents of the allocated memory ?
Any help regarding this will be appreciated.
Rgds,
Mayank
--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss