#include <tlStd.h>
#include <TlApi/TlApiHeap.h>
#include <stdlib.h>

#ifndef _NEWLIB_VERSION
	#error you included fixes specifically created for newlib library, but you use different library in your project. This file must only be included into the build if toolchain is clang/llvm and libc library is newlib.
#endif

_PTR _EXFUN_NOTHROW(_malloc_r,(struct _reent *r, size_t size))
{
    return tlApiMalloc(size, 0);
}

_VOID _EXFUN_NOTHROW(_free_r,(struct _reent *r, _PTR buffer))
{
	tlApiFree(buffer);
}

_PTR _EXFUN_NOTHROW(_realloc_r,(struct _reent *r, _PTR buffer, size_t size))
{
    return tlApiRealloc(buffer, size);
}
