4.8.7. __Heap_Alloc()

Allocates memory from the heap to the application.


void __Heap_Alloc(struct __Heap_Descriptor* h, size_t size);


This is called from malloc(), and mustreturn a pointer to size bytes of memory allocated from the heap, or NULL if nothing can be allocated. You must ensure that the size of the block can be determined when it is time to free it. The returned block size is typically stored in the word immediately before its start address. The default implementation of this function allocates an 8-byte aligned block of memory. If you reimplement this function it is recommended that you return 8-byte aligned blocks of memory.

Copyright © 1999-2001 ARM Limited. All rights reserved.ARM DUI 0067D