This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
malloc initialization problem
- From: sensitron medical <sensitronnet at yahoo dot com>
- To: ecos <ecos-discuss at sources dot redhat dot com>
- Date: Tue, 1 Apr 2003 13:55:02 -0800 (PST)
- Subject: [ECOS] malloc initialization problem
Forgot to mention that I am using ecos2.0. I am in the
process of testing 1.3.1.
My malloc does not fail if the size of the heap is
exceeded; I can malloc indefinitely. I traced this to
the constructor (see below), which is where I believe
the heap size is set (is this true?). Here's the
constructor for memvar.cxx instrumented with two
globals (caSize and caBase) that I can examine with an
emulator after the construtor executes:
//
-------------------------------------------------------------------------
// Constructor: gives the base and size of the arena
in which memory is
// to be carved out
cyg_int32 caSize = 0;
cyg_uint8 *caBase = 0;
Cyg_Mempool_Variable::Cyg_Mempool_Variable(
cyg_uint8 *base,
cyg_int32 size,
cyg_int32 alignment)
: mypool( base, size, (CYG_ADDRWORD)alignment )
{
caSize = size;
caBase = base;
}
caSize is set to 33907992. I have no idea where it is
getting this number from since the size of the heap is
16384.
I say that the size of the heap is 16384 because I
have:
#define CYGNUM_MEMALLOC_FALLBACK_MALLOC_POOL_SIZE
16384
I have tried both the simple variable allocator and
Doug Lea's allocator. They both have bogus sizes,
although they are not the same value.
__________________________________________________
Do you Yahoo!?
Yahoo! Tax Center - File online, calculators, forms, and more
http://platinum.yahoo.com
--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss