mirror of
https://github.com/Fishwaldo/bl_mcu_sdk.git
synced 2025-07-08 22:08:40 +00:00
[feat][platform] add cxx new interface support
This commit is contained in:
parent
ecb43ef0d0
commit
bec13de776
1 changed files with 22 additions and 0 deletions
22
bsp/bsp_common/platform/cpp_new.cpp
Normal file
22
bsp/bsp_common/platform/cpp_new.cpp
Normal file
|
@ -0,0 +1,22 @@
|
|||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
|
||||
void *operator new(size_t size)
|
||||
{
|
||||
return malloc(size);
|
||||
}
|
||||
|
||||
void *operator new[](size_t size)
|
||||
{
|
||||
return malloc(size);
|
||||
}
|
||||
|
||||
void operator delete(void *ptr)
|
||||
{
|
||||
free(ptr);
|
||||
}
|
||||
|
||||
void operator delete[](void *ptr)
|
||||
{
|
||||
free(ptr);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue