This is the mail archive of the ecos-discuss@sourceware.org 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]
Other format: [Raw text]

Re: malloc1 test and posix stdio fails


On Tue, 16 May 2006, Andrew Lunn wrote:

> >     poolmax = mallinfo().maxfree;
> 
> It would be interesting to see all the return values from
> mallinfo(). Could you print them out please.

All zero!

> This size is only used when there is
> no automatic heap definition. Normally everything between the end of
> the bss and top of memory is used as heap.

> And this confirms that an automaticly sized heap is being used.

Ok. Here's map from malloc1 ELF file:


Sections:
Idx Name          Size      VMA       LMA       File off  Algn


  7 .rom_vectors  00000040  00000000  00000000  00008000  2**0
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
  8 .text         00017b04  00000040  00000040  00008040  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
  9 .fini         00000000  00017b44  00017b44  000e98fe  2**0
                  CONTENTS
 10 .rodata       00006000  00017b44  00017b44  0001fb44  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
 11 .rodata1      00000000  0001db44  0001db44  000e98fe  2**0
                  CONTENTS
 14 .fixed_vectors 00000140  81200400  81200400  000e9900  2**5
                  CONTENTS, READONLY

 15 .data         000006b8  81200540  0001db44  00028540  2**2
                  CONTENTS, ALLOC, LOAD, DATA
 16 .bss          00004d4c  81200bf8  81200bf8  00028bf8  2**4
                  ALLOC
-----------------------------------------------------------------
and a dump showing __heap1

81205948 A __heap1
81200ac0 D cygmem_memalloc_heaps
812033b4 B cygmem_pool_heap1

---------------------------

Hmm. If I do the arithmetic and I understand things correctly,

my heap pointer __heap1 = 8120 5948
which is 4 bytes past the end of bss = ( 8120 0bf8 + 0000 4d4c ) = 
0x8120 5944

which would seem to be incorrect. My RAM allocation (as per my linker 
file sent in previous message) ends at 8120 0000 + 20 0000 = 8140 0000

Therefore I conclude __heap1 is sent incorrectly.

Is that right?

Brett



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


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