1MBKREALLOC(3)                MBK UTILITY FUNCTIONS               MBKREALLOC(3)
2
3
4

NAME

6       mbkrealloc - mbk memory reallocator
7

SYNOPSIS

9       #include "mut.h"
10       void ∗mbkrealloc(pt, bytes)
11       void ∗pt;
12       unsigned int bytes;
13

PARAMETERS

15       pt                  Pointer  to  an  already  allocated area, allocated
16                           using mbkallocP
17
18       bytes               Number of memory bytes to be contiguously allocated
19

DESCRIPTION

21       mbkrealloc returns a block  of  bytes  length,  for  any  purpose.   It
22       increases  or  decreases  the size of the area, and return a pointer to
23       the new block.  It is now a day only an  encapsulation  of  the  system
24       realloc  function, but may evolve to a special allocator in the future.
25       Its use is strongly encouraged.
26
27       Remark :            a global variable,  long  mbkrealloc_stat,  updates
28                           the  number of allocated bytes, and may be accessed
29                           by anyone to see the amount of allocated memory.
30

RETURN VALUE

32       mbkrealloc returns a pointer to a bytes long block.
33

ERROR

35       "∗∗∗ mbk error ∗∗∗ mbkrealloc impossible : not enough memory"
36              System break can't be moved  anymore,  no  more  memory  can  be
37              retrieved from the system.
38

EXAMPLE

40       #include "mut.h"
41       char ∗concatstring(t, s);
42       {
43          t = (char ∗)mbkrealloc(strlen(t) + strlen(s) + 1);
44          strcat(t, s);
45          return t;
46       }
47

SEE ALSO

49       mbk(1), mbkalloc(3), mbkfree(3).
50
51
52
53
54
55
56ASIM/LIP6                       October 1, 1997                  MBKREALLOC(3)
Impressum