Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of Smoothie by
ahbmalloc.cpp
00001 #include "ahbmalloc.h" 00002 00003 #include <cstring> 00004 00005 #include <cstdint> 00006 // #include <stdio.h> 00007 00008 #include "platform_memory.h" 00009 00010 void* ahbmalloc(size_t size, BANK bank) 00011 { 00012 switch(bank) 00013 { 00014 case AHB_BANK_0: 00015 return AHB0.alloc(size); 00016 case AHB_BANK_1: 00017 return AHB1.alloc(size); 00018 default: 00019 return NULL; 00020 } 00021 } 00022 00023 void ahbfree(void* ptr, size_t size) 00024 { 00025 MemoryPool* m = MemoryPool::first; 00026 while (m) 00027 { 00028 if (m->has(ptr)) 00029 { 00030 m->dealloc(ptr); 00031 return; 00032 } 00033 m = m->next; 00034 } 00035 }
Generated on Tue Jul 12 2022 20:09:00 by
1.7.2
