heap size .bss section

Hello,

How is it possible to see if a heap buffer overflow occured?

I just took a look into the .map file and the size of the .bss section is 0x00003c28. I've 16kB internal RAM. The size of the stack is 0x00000488, which is enough for my application.

In the startup code the heap size is

Heap_Size       EQU     0x00000000

                AREA    HEAP, NOINIT, READWRITE, ALIGN=3
__heap_base
Heap_Mem        SPACE   Heap_Size
__heap_limit

Does this means, that the heap size is the rest of the internal memory (up to the stack size)? And so everthing is correct (in my settings)?

best regards
Bernd

Parents
  • Heap_Size defines the size of heap which is placed in memory after variables and before stack.

    It is also registered by the run time library and the available heap size is checked for example when malloc is used. If not enough memory is available a NULL pointer will be returned for malloc (but no overflow will occur).

    You need to configure Heap_Size in accordance to your application requirements.

Reply
  • Heap_Size defines the size of heap which is placed in memory after variables and before stack.

    It is also registered by the run time library and the available heap size is checked for example when malloc is used. If not enough memory is available a NULL pointer will be returned for malloc (but no overflow will occur).

    You need to configure Heap_Size in accordance to your application requirements.

Children
More questions in this forum