assign size

This commit is contained in:
iceman1001 2020-08-31 23:02:41 +02:00
commit 4cc3fd9397
2 changed files with 5 additions and 6 deletions

View file

@ -21,9 +21,6 @@ extern uint8_t _stack_start, __bss_end__;
// We know that bss is aligned to 4 bytes.
static uint8_t *BigBuf = &__bss_end__;
void *UMM_MALLOC_CFG_HEAP_ADDR = &__bss_end__;
uint32_t UMM_MALLOC_CFG_HEAP_SIZE = (uint32_t)&_stack_start - (uint32_t)&__bss_end__;
/* BigBuf memory layout:
Pointer to highest available memory: s_bigbuf_hi
high s_bigbuf_size

View file

@ -49,11 +49,9 @@
#define DBGLOG_LEVEL 0
//#include "dbglog/dbglog.h"
#include "dbprint.h"
extern void *UMM_MALLOC_CFG_HEAP_ADDR;
extern uint32_t UMM_MALLOC_CFG_HEAP_SIZE;
extern uint8_t _stack_start, __bss_end__;
/* ------------------------------------------------------------------------- */
@ -232,6 +230,10 @@ static uint16_t umm_assimilate_down( uint16_t c, uint16_t freemask ) {
/* ------------------------------------------------------------------------- */
void umm_init( void ) {
void *UMM_MALLOC_CFG_HEAP_ADDR = &__bss_end__;
uint32_t UMM_MALLOC_CFG_HEAP_SIZE = (uint32_t)&_stack_start - (uint32_t)&__bss_end__;
/* init heap pointer and size, and memset it to 0 */
umm_heap = (umm_block *)UMM_MALLOC_CFG_HEAP_ADDR;
umm_numblocks = (UMM_MALLOC_CFG_HEAP_SIZE / sizeof(umm_block));