Add FS #10214. Initial commit of the original PDa code for the GSoC Pure Data plugin...
[kugel-rb.git] / apps / plugins / pdbox / dbestfit-3.3 / malloc.man
blob79f6f3ea37502e4ba8e0ba6ca31de5950e8115be
1 MALLOC(3V)             C LIBRARY FUNCTIONS             MALLOC(3V)
4 NAME
5      malloc, free, realloc, calloc
7 SYNOPSIS
8      #include <malloc.h>
10      void *malloc(size)
11      size_t size;
13      void free(ptr)
14      void *ptr;
16      void *realloc(ptr, size)
17      void *ptr;
18      size_t size;
20      void *calloc(nelem, elsize)
21      size_t nelem;
22      size_t elsize;
24 DESCRIPTION
25      These routines provide a general-purpose  memory  allocation
26      package.  They maintain a table of free blocks for efficient
27      allocation and coalescing of free storage.  When there is no
28      suitable  space  already  free, the allocation routines call
29      rn_getseg() to get more memory from the system.
31      Each of the allocation routines returns a pointer  to  space
32      suitably  aligned  for  storage  of any type of object. Each
33      returns a NULL pointer if the request  cannot  be  completed
34      (see DIAGNOSTICS).
36      malloc() returns a pointer to  a  block  of  at  least  size
37      bytes, which is appropriately aligned.
39      free() releases a previously allocated block.  Its  argument
40      is  a  pointer  to a block previously allocated by malloc(),
41      calloc() or realloc().
43      realloc() changes the size of the block referenced by ptr to
44      size  bytes  and  returns  a pointer to the (possibly moved)
45      block.  The contents will be unchanged up to the  lesser  of
46      the  new  and  old sizes.  If unable to honor a reallocation
47      request, realloc() leaves its first argument unaltered.
49      **** DMALLOC DOES NOT COMPLY WITH THE PARAGRAPH BELOW ****
51      For backwards  compatibility,  realloc()  accepts a pointer to a
52      block freed since the most recent  call  to  malloc(),  cal-
53      loc() or  realloc().
55      Note: using realloc() with a block freed before the most recent
56      call to malloc(), calloc() or realloc() is an error.
58      calloc() uses malloc() to allocate space  for  an  array  of
59      nelem  elements  of  size  elsize,  initializes the space to
60      zeros, and returns a pointer to the initialized block.   The
61      block should be freed with free().
64      malloc() and realloc() return a non- NULL pointer if size is 0,
65      and calloc() returns a non-NULL pointer if nelem or elsize is 0,
66      but these pointers should not be dereferenced.
68      Note: Always cast the value returned by malloc(), realloc() or
69      calloc().
72 RETURN VALUES On success, malloc(), calloc() and realloc() return a
73      pointer to space suitably aligned for storage of any type of
74      object.  On failure, they return NULL.
76      free() does not return a value.
79 NOTES
80      Because malloc() and realloc() return a non-NULL pointer if size
81      is 0, and calloc() returns a non-NULL pointer if nelem or elsize
82      is 0, a zero size need not be treated as a special case if it
83      should be passed to these functions unpredictably.  Also, the
84      pointer returned by these functions may be passed to subsequent
85      invocations of realloc().
88 BUGS
90      **** DMALLOC DOES NOT COMPLY WITH THE PARAGRAPH BELOW ****
92      Since realloc() accepts a pointer to a block freed since the last
93      call to malloc(), calloc() or realloc(), a degradation of
94      performance results.  The semantics of free() should be changed
95      so that the contents of a previously freed block are undefined.
96 MALLOC(3V)             C LIBRARY FUNCTIONS             MALLOC(3V)
99 NAME
100      malloc, free, realloc, calloc
102 SYNOPSIS
103      #include <malloc.h>
105      void *malloc(size)
106      size_t size;
108      void free(ptr)
109      void *ptr;
111      void *realloc(ptr, size)
112      void *ptr;
113      size_t size;
115      void *calloc(nelem, elsize)
116      size_t nelem;
117      size_t elsize;
119 DESCRIPTION
120      These routines provide a general-purpose  memory  allocation
121      package.  They maintain a table of free blocks for efficient
122      allocation and coalescing of free storage.  When there is no
123      suitable  space  already  free, the allocation routines call
124      rn_getseg() to get more memory from the system.
126      Each of the allocation routines returns a pointer  to  space
127      suitably  aligned  for  storage  of any type of object. Each
128      returns a NULL pointer if the request  cannot  be  completed
129      (see DIAGNOSTICS).
131      malloc() returns a pointer to  a  block  of  at  least  size
132      bytes, which is appropriately aligned.
134      free() releases a previously allocated block.  Its  argument
135      is  a  pointer  to a block previously allocated by malloc(),
136      calloc() or realloc().
138      realloc() changes the size of the block referenced by ptr to
139      size  bytes  and  returns  a pointer to the (possibly moved)
140      block.  The contents will be unchanged up to the  lesser  of
141      the  new  and  old sizes.  If unable to honor a reallocation
142      request, realloc() leaves its first argument unaltered.
144      **** DMALLOC DOES NOT COMPLY WITH THE PARAGRAPH BELOW ****
146      For backwards  compatibility,  realloc()  accepts a pointer to a
147      block freed since the most recent  call  to  malloc(),  cal-
148      loc() or  realloc().
150      Note: using realloc() with a block freed before the most recent
151      call to malloc(), calloc() or realloc() is an error.
153      calloc() uses malloc() to allocate space  for  an  array  of
154      nelem  elements  of  size  elsize,  initializes the space to
155      zeros, and returns a pointer to the initialized block.   The
156      block should be freed with free().
159      malloc() and realloc() return a non- NULL pointer if size is 0,
160      and calloc() returns a non-NULL pointer if nelem or elsize is 0,
161      but these pointers should not be dereferenced.
163      Note: Always cast the value returned by malloc(), realloc() or
164      calloc().
167 RETURN VALUES On success, malloc(), calloc() and realloc() return a
168      pointer to space suitably aligned for storage of any type of
169      object.  On failure, they return NULL.
171      free() does not return a value.
174 NOTES
175      Because malloc() and realloc() return a non-NULL pointer if size
176      is 0, and calloc() returns a non-NULL pointer if nelem or elsize
177      is 0, a zero size need not be treated as a special case if it
178      should be passed to these functions unpredictably.  Also, the
179      pointer returned by these functions may be passed to subsequent
180      invocations of realloc().
183 BUGS
185      **** DMALLOC DOES NOT COMPLY WITH THE PARAGRAPH BELOW ****
187      Since realloc() accepts a pointer to a block freed since the last
188      call to malloc(), calloc() or realloc(), a degradation of
189      performance results.  The semantics of free() should be changed
190      so that the contents of a previously freed block are undefined.