Skip to content

Commit 736c5d3

Browse files
author
Chris Trowbridge
committed
Add mbed support for malloc() and free()
1 parent af02b3e commit 736c5d3

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

erpc_c/port/erpc_port_mbed.cpp

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/*
2+
* Copyright (c) 2020, Embedded Planet, Inc
3+
* All rights reserved.
4+
*
5+
* For supporting transports and examples see:
6+
* https://github.com/EmbeddedPlanet/mbed-rpc
7+
*
8+
* SPDX-License-Identifier: BSD-3-Clause
9+
*/
10+
11+
#include "erpc_port.h"
12+
13+
#if ERPC_THREADS_IS(MBED)
14+
15+
#include <cstdlib>
16+
17+
using namespace std;
18+
19+
void *erpc_malloc(size_t size)
20+
{
21+
void *p = malloc(size);
22+
return p;
23+
}
24+
25+
void erpc_free(void *ptr)
26+
{
27+
free(ptr);
28+
}
29+
#endif

0 commit comments

Comments
 (0)