This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: malloc (increasing size of heap)


Warren Jasper wrote:
> 
> I want to read a file from the romfs into a buffer.  When I call malloc(),
> I get an error.  Where is the size of the heap set in eCos and how can
> I increase it. 

It is defined in the memory layout as a user-defined section of name
__heap1, and normally runs up to the end of RAM (at least, the end as
configured in the memory layout). Therefore it couldn't be increased unless
your layout is wrong.

Although, if heap1 _isn't_ defined in your memory layout, a fixed size
fallback is used instead.

> Should I be using memory pools instead?

Dunno. Depends. memory pools are lower overhead and more manageable.

Jifl
-- 
Red Hat, Rustat House, Clifton Road, Cambridge, UK. Tel: +44 (1223) 271062
Maybe this world is another planet's Hell -Aldous Huxley || Opinions==mine


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]