assign size
This commit is contained in:
@@ -21,9 +21,6 @@ extern uint8_t _stack_start, __bss_end__;
|
|||||||
// We know that bss is aligned to 4 bytes.
|
// We know that bss is aligned to 4 bytes.
|
||||||
static uint8_t *BigBuf = &__bss_end__;
|
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:
|
/* BigBuf memory layout:
|
||||||
Pointer to highest available memory: s_bigbuf_hi
|
Pointer to highest available memory: s_bigbuf_hi
|
||||||
high s_bigbuf_size
|
high s_bigbuf_size
|
||||||
|
|||||||
@@ -49,11 +49,9 @@
|
|||||||
|
|
||||||
#define DBGLOG_LEVEL 0
|
#define DBGLOG_LEVEL 0
|
||||||
|
|
||||||
//#include "dbglog/dbglog.h"
|
|
||||||
#include "dbprint.h"
|
#include "dbprint.h"
|
||||||
|
|
||||||
extern void *UMM_MALLOC_CFG_HEAP_ADDR;
|
extern uint8_t _stack_start, __bss_end__;
|
||||||
extern uint32_t UMM_MALLOC_CFG_HEAP_SIZE;
|
|
||||||
|
|
||||||
/* ------------------------------------------------------------------------- */
|
/* ------------------------------------------------------------------------- */
|
||||||
|
|
||||||
@@ -232,6 +230,10 @@ static uint16_t umm_assimilate_down( uint16_t c, uint16_t freemask ) {
|
|||||||
/* ------------------------------------------------------------------------- */
|
/* ------------------------------------------------------------------------- */
|
||||||
|
|
||||||
void umm_init( void ) {
|
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 */
|
/* init heap pointer and size, and memset it to 0 */
|
||||||
umm_heap = (umm_block *)UMM_MALLOC_CFG_HEAP_ADDR;
|
umm_heap = (umm_block *)UMM_MALLOC_CFG_HEAP_ADDR;
|
||||||
umm_numblocks = (UMM_MALLOC_CFG_HEAP_SIZE / sizeof(umm_block));
|
umm_numblocks = (UMM_MALLOC_CFG_HEAP_SIZE / sizeof(umm_block));
|
||||||
|
|||||||
Reference in New Issue
Block a user