28#if defined(__ARM_EABI__) || defined(__DOXYGEN__)
111#if defined(OS_TRACE_LIBC_MALLOC)
167 if (nelem == 0 || elbytes == 0)
179#if defined(OS_TRACE_LIBC_MALLOC)
180 trace::printf (
"::%s(%u,%u)=%p\n", __func__, nelem, elbytes, mem);
187 memset (mem, 0, nelem * elbytes);
275#if defined(OS_TRACE_LIBC_MALLOC)
276 trace::printf (
"::%s(%p,%u)=%p\n", __func__, ptr, bytes, mem);
288#if defined(OS_TRACE_LIBC_MALLOC)
297 if (nano_malloc_usable_size (RCALL ptr) >= bytes)
304 memcpy (mem, ptr, bytes);
312#if defined(OS_TRACE_LIBC_MALLOC)
364#if defined(OS_TRACE_LIBC_MALLOC)
389_malloc_r (
struct _reent* impure __attribute__((unused)),
size_t size)
395_calloc_r (
struct _reent* impure __attribute__((unused)),
size_t n,
size_t elem)
401_free_r (
struct _reent* impure __attribute__((unused)),
void* ptr)
407_realloc_r (
struct _reent* impure __attribute__((unused)),
void* ptr,
424#pragma GCC diagnostic push
425#pragma GCC diagnostic ignored "-Waggregate-return"
428_mallinfo_r (struct _reent* impure __attribute__((unused)))
433#pragma GCC diagnostic pop
436_malloc_stats_r (
struct _reent* impure __attribute__((unused)))
442_malloc_usable_size_r (
struct _reent* reent __attribute__((unused)),
443 void* ptr __attribute__((unused)))
449_mallopt_r (
struct _reent* impure __attribute__((unused)),
450 int parameter_number __attribute__((unused)),
451 int parameter_value __attribute__((unused)))
457_memalign_r (
struct _reent* impure __attribute__((unused)),
458 size_t align __attribute__((unused)),
459 size_t s __attribute__((unused)))
465_pvalloc_r (
struct _reent* impure __attribute__((unused)),
466 size_t s __attribute__((unused)))
472_valloc_r (
struct _reent* impure __attribute__((unused)),
473 size_t s __attribute__((unused)))
void deallocate(void *addr, std::size_t bytes, std::size_t alignment=max_align) noexcept
Deallocate the previously allocated memory block.
void * allocate(std::size_t bytes, std::size_t alignment=max_align)
Allocate a memory block.
Scheduler critical section RAII helper.
int printf(const char *format,...)
Write a formatted string to the trace device.
void * realloc(void *ptr, size_t bytes)
Reallocate the memory block (non-initialised).
void * calloc(size_t nelem, size_t elbytes)
Allocate an array of memory blocks (initialised to zero).
void * malloc(size_t bytes)
Allocate a memory block (non-initialised).
void free(void *ptr)
Free the allocated memory block.
memory_resource * get_default_resource(void) noexcept
Get the default application memory manager.
bool in_handler_mode(void)
Check if the CPU is in handler mode.
Single file µOS++ RTOS definitions.