|
BSPACM
20150113
Board Support Package for ARM Cortex-M Microcontrollers
|
Prototypes for BSPACM system enhancements to newlib. More...
Go to the source code of this file.
Functions | |
| void * | _sbrk (intptr_t increment) |
| void * | _bspacm_sbrk_error (void *brk, ptrdiff_t current, ptrdiff_t increment) |
Prototypes for BSPACM system enhancements to newlib.
| void* _bspacm_sbrk_error | ( | void * | brk, |
| ptrdiff_t | current, | ||
| ptrdiff_t | increment | ||
| ) |
This function is invoked whenever _sbrk() runs out of memory.
libbspacm.a provides a weak definition is that disables interrupts and enters an infinite loop, allowing diagnosis through a debugger. The application may provide an alternative implementation that is more diagnostic or that returns the responsibility of handling out-of-memory to the application (i.e. requires the application to check allocation return values).
| brk | the current program break |
| current | total number of bytes allocated by previous successful invocations of _sbrk() (i.e., allocated bytes preceding brk) |
| increment | the number of bytes in the request that _sbrk() cannot satisfy |
errno to ENOMEM and return (void*)-1. | void* _sbrk | ( | intptr_t | increment | ) |
The system function used to allocate memory for use by libc heap memory management.
Heap Management documents how to select a specific _sbrk() implementation from among the available policies by which allocation is done, and how to supply your own implementation.
| increment | the number of bytes of additional memory that libc needs in order to perform additional allocations. |
(void*)-1 if no allocation can be performed.
1.8.9