[ECOS] malloc initialization problem

Jonathan Larmour jifl@eCosCentric.com
Tue Apr 1 22:38:00 GMT 2003


sensitron medical wrote:
> 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:

Not necessarily. CYGNUM_MEMALLOC_FALLBACK_MALLOC_POOL_SIZE is only used 
when there is no "heap1" section defined in the platform's linker script. 
If heap1 is defined, that will be used and the fallback value ignored 
because it is exactly that - a fallback.

So my guess is that that is where the value is coming from. If the value 
is incorrect you have to fix your platform's memory layout.

Jifl
-- 
eCosCentric    http://www.eCosCentric.com/    The eCos and RedBoot experts
--[ "You can complain because roses have thorns, or you ]--
--[  can rejoice because thorns have roses." -Lincoln   ]-- Opinions==mine


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



More information about the Ecos-discuss mailing list