ARM VERSION 1.2 Ficha Técnica Página 153

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 276
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 152
The C and C++ Libraries
ARM DUI 0067D Copyright © 1999-2001 ARM Limited. All rights reserved. 4-63
4.8.6 __Heap_ProvideMemory()
Called to increase the size of the heap.
Syntax
void __Heap_ProvideMemory(struct __Heap_Descriptor* h, void* base, size_t size)
Implementation
This is called when the system provides a chunk of memory for use by the heap. The
parameters are:
your heap descriptor
a pointer to a new 8-byte aligned block of memory
the size of the block.
__Heap_ProvideMemory()
can assume that the input block is 8-byte aligned. A typical
__Heap_ProvideMemory()
implementation might set up the new block of memory as a
free-list entry and add it to the free chain.
4.8.7 __Heap_Alloc()
Allocates memory from the heap to the application.
Syntax
void __Heap_Alloc(struct __Heap_Descriptor* h, size_t size)
Implementation
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.
Vista de página 152
1 2 ... 148 149 150 151 152 153 154 155 156 157 158 ... 275 276

Comentários a estes Manuais

Sem comentários