• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /**
2  * @defgroup malloc Malloc
3  * @ingroup libc
4  */
5 
6 #ifndef _MALLOC_H
7 #define _MALLOC_H
8 
9 #ifdef __cplusplus
10 extern "C" {
11 #endif
12 
13 #define __NEED_size_t
14 
15 #include <bits/alltypes.h>
16 
17 /**
18  * @ingroup  malloc
19  *
20  * @par Description:
21  * The malloc() function shall allocate unused space for an object whose size in bytes is specified by byte_count
22  * and whose value is unspecified. If byte_count is 0, then malloc() returns NULL.
23  *
24  * @attention
25  * <ul>
26  * <li>None.</li>
27  * </ul>
28  *
29  * @retval #void* Upon successful completion with byte_count not equal to 0, malloc() shall return a pointer to the allocated space.
30  *              If byte_count is 0, it shall return a null pointer.
31  *
32  * @par Dependency:
33  * <ul><li>malloc.h</li></ul>
34  * @see calloc | free | posix_memalign | realloc
35  */
36 void *malloc (size_t);
37 void *calloc (size_t, size_t);
38 void *realloc (void *, size_t);
39 void free (void *);
40 void *valloc (size_t);
41 void *memalign(size_t, size_t);
42 
43 size_t malloc_usable_size(void *);
44 
45 #ifdef __LITEOS__
46 void *zalloc(size_t);
47 #endif
48 
49 #ifdef __cplusplus
50 }
51 #endif
52 
53 #endif
54