Skip to content
Snippets Groups Projects
Commit a39862b5 authored by Oleg Hahm's avatar Oleg Hahm
Browse files

Merge pull request #4503 from OlegHahm/make_native_use_tlsf

native: make use of TLSF malloc and co
parents 6c521916 6d135d35
No related branches found
No related tags found
No related merge requests found
...@@ -134,6 +134,10 @@ void _native_syscall_leave(void) ...@@ -134,6 +134,10 @@ void _native_syscall_leave(void)
} }
} }
/* make use of TLSF if it is included, except when building with valgrind
* support, where one probably wants to make use of valgrind's memory leak
* detection abilities*/
#if !(defined MODULE_TLSF) || (defined(HAVE_VALGRIND_H))
int _native_in_malloc = 0; int _native_in_malloc = 0;
void *malloc(size_t size) void *malloc(size_t size)
{ {
...@@ -204,6 +208,7 @@ void *realloc(void *ptr, size_t size) ...@@ -204,6 +208,7 @@ void *realloc(void *ptr, size_t size)
_native_syscall_leave(); _native_syscall_leave();
return r; return r;
} }
#endif /* !(defined MODULE_TLSF) || (defined(HAVE_VALGRIND_H)) */
ssize_t _native_read(int fd, void *buf, size_t count) ssize_t _native_read(int fd, void *buf, size_t count)
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment