4.8.12. __Heap_Full()

Attempts to acquire a new block of at least size bytes from the system. You must not re-implement this function.

Syntax

int __Heap_Full(struct __Heap_Descriptor *h, size_t size);

Implementation

If __Heap_Alloc() or __Heap_Realloc() cannotallocate a block of the required size from the memory owned by the heap, then before giving up and returning NULL, they can try calling this routine.

You must provide space for heap housekeeping data. If the user asks for 1000 bytes and you store a word before every allocated block, you must ask __Heap_Full() for 1004 bytes, not 1000.

Before calling __Heap_Full(), you must ensure that the heap data structures are in a consistent state so that __Heap_ProvideMemory() calls can add the new block to the heap successfully.

Returns

If __Heap_Full() is successful, it calls __Heap_ProvideMemory() to add the new block to the heap, and return nonzero. If it fails, it returns 0.

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