Realloc

Top  Previous  Next

The size of a memory block change.

With Realloc is able to come Malloc or Calloc requested storage area are changed in his size. He is able increases, as well as are reduced. Because a sufficient space is not always available behind the already existing memory block, a new memory block is requested if necessary and the contents are copied.

In the momentary Implementation a new block is always returned.

Parametre

perch (void *) [IN]

Pointer on one with Malloc or Calloc requested memory block.

size (size_t) [IN]

desired new length for the memory block perch.

Result

(void *) [OUT]

The procedure returns an untyped pointer on the changed storage area. If a mistake has appeared, ZERO is delivered as a result. The contents of the memory perch is preserved.

Declaration

#include "basic.h"

 

void *Realloc (

void * perch,

size_t size

);