42 #define HEAP_START ((uint32_t) & (_heap_start)) 43 #define HEAP_END ((uint32_t) (0x3FFFC000UL - 1UL)) 53 void *p = (
void *)os_zalloc( size );
56 printf(
"mcalloc(%d) failed!\n", size);
69 void *
calloc(
size_t nmemb,
size_t size)
71 void *p = (
void *)os_zalloc( (nmemb * size) );
74 printf(
"calloc(%d,%d) failed!\n", nmemb, size);
95 printf(
"free: FREE ERROR (%08x)\n", p);
106 return ((
size_t) system_get_free_heap_size());
115 printf(
"Heap Free(%d) bytes\n" , system_get_free_heap_size());
116 printf(
"Heap Start(%08x), Heap End(%08x), Delta(%d)\n" ,
130 void *p =
calloc(nmemb, size);
133 printf(
"safecalloc(%d,%d) failed!\n", nmemb, size);
173 printf(
"safefree: FREE ERROR (%08x)\n", p);
192 WRITE_PERI_REG(0x60000914, 0x73);
MEMSPACE size_t freeRam()
Return Free memory.
void * _heap_start
calloc may be aliased to safecalloc
Master include file for project Includes all project includes and defines here.
MEMSPACE void reset(void)
reset system
MEMSPACE void PrintRam()
Display Free memory and regions.
MEMSPACE void * calloc(size_t nmemb, size_t size)
calloc buffer POSIX function
MEMSPACE void free(void *p)
Free buffer POSIX function We only call os_free() is pointer is not null.
MEMSPACE void * safemalloc(size_t size)
Safe Malloc - Display Error message if Malloc fails.
MEMSPACE void * malloc(size_t size)
malloc buffer POSIX function
Math IO functions, and verious conversion code with floating point support.
MEMSPACE void wdt_reset(void)
reset watchdog
MEMSPACE int printf(const char *format,...)
System memory and reset utilities.
MEMSPACE void safefree(void *p)
Safe free - Only free a pointer if it is in malloc memory range. We want to try to catch frees of sta...
MEMSPACE void * safecalloc(size_t nmemb, size_t size)
Safe Calloc - Display Error message if Calloc fails.