1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-04-19 23:22:16 +03:00

Move umm_info into cache

This commit is contained in:
Ivan Grokhotkov 2016-02-17 11:42:52 +03:00
parent fec1a64bfd
commit 707c87fdb6
3 changed files with 10 additions and 3 deletions

View File

@ -32,7 +32,7 @@ void* ICACHE_RAM_ATTR pvPortZalloc(size_t size, const char* file, int line)
return calloc(1, size); return calloc(1, size);
} }
size_t ICACHE_RAM_ATTR xPortGetFreeHeapSize(void) size_t xPortGetFreeHeapSize(void)
{ {
return umm_free_heap_size(); return umm_free_heap_size();
} }

View File

@ -967,7 +967,7 @@ static void *get_unpoisoned( unsigned char *ptr ) {
UMM_HEAP_INFO ummHeapInfo; UMM_HEAP_INFO ummHeapInfo;
void *umm_info( void *ptr, int force ) { void ICACHE_FLASH_ATTR *umm_info( void *ptr, int force ) {
unsigned short int blockNo = 0; unsigned short int blockNo = 0;
@ -1728,7 +1728,7 @@ void umm_free( void *ptr ) {
/* ------------------------------------------------------------------------ */ /* ------------------------------------------------------------------------ */
size_t umm_free_heap_size( void ) { size_t ICACHE_FLASH_ATTR umm_free_heap_size( void ) {
umm_info(NULL, 0); umm_info(NULL, 0);
return (size_t)ummHeapInfo.freeBlocks * sizeof(umm_block); return (size_t)ummHeapInfo.freeBlocks * sizeof(umm_block);
} }

View File

@ -6,6 +6,13 @@
#define _UMM_MALLOC_CFG_H #define _UMM_MALLOC_CFG_H
#include <debug.h> #include <debug.h>
#ifdef __cplusplus
#extern "C" {
#endif
#include "c_types.h"
#ifdef __cplusplus
}
#endif
/* /*
* There are a number of defines you can set at compile time that affect how * There are a number of defines you can set at compile time that affect how
* the memory allocator will operate. * the memory allocator will operate.