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

NAME

6       mbkalloc - mbk memory allocator
7

SYNOPSIS

9       #include "mut.h"
10       char ∗mbkalloc(bytes)
11       unsigned int bytes;
12

PARAMETER

14       bytes               Number of memory bytes to be contiguously allocated
15

DESCRIPTION

17       mbkalloc returns a block of bytes length, for any purpose.  It is now a
18       day just an encapsulation of the system malloc function, but may evolve
19       to a special allocator in the future. Its use is strongly encouraged.
20
21       Remark :            a  global variable, long mbkalloc_stat, updates the
22                           number of allocated bytes, and may be  accessed  by
23                           anyone to see the amount of allocated memory.
24

RETURN VALUE

26       mbkalloc returns a pointer to a bytes long block.
27

ERROR

29       "∗∗∗ mbk error ∗∗∗ mbkalloc impossible : not enough memory"
30              System  break  can't  be  moved  anymore,  no more memory can be
31              retrieved from the system.
32

EXAMPLE

34       #include "mut.h"
35       char ∗dup_str(s);
36       {
37       char ∗t = (char ∗)mbkalloc(strlen(s) + (unsigned int)1);
38          strcpy(t, s);
39          return t;
40       }
41

SEE ALSO

43       mbk(1), mbkfree(3).
44
45
46
47
48
49
50ASIM/LIP6                       October 1, 1997                    MBKALLOC(3)
Impressum