|
@@ -9,11 +9,16 @@
|
9
|
9
|
*
|
10
|
10
|
*/
|
11
|
11
|
|
|
12
|
+/*
|
|
13
|
+ * Prototypes for the standard functions (malloc() et al) are in
|
|
14
|
+ * stdlib.h. Include <malloc.h> only if you need the non-standard
|
|
15
|
+ * functions, such as malloc_dma().
|
|
16
|
+ *
|
|
17
|
+ */
|
|
18
|
+#include <stdlib.h>
|
|
19
|
+
|
12
|
20
|
extern void * alloc_memblock ( size_t size, size_t align );
|
13
|
21
|
extern void free_memblock ( void *ptr, size_t size );
|
14
|
|
-extern void * realloc ( void *old_ptr, size_t new_size );
|
15
|
|
-extern void * malloc ( size_t size );
|
16
|
|
-extern void free ( void *ptr );
|
17
|
22
|
extern void mpopulate ( void *start, size_t len );
|
18
|
23
|
extern void mdumpfree ( void );
|
19
|
24
|
|
|
@@ -47,21 +52,4 @@ static inline void free_dma ( void *ptr, size_t size ) {
|
47
|
52
|
free_memblock ( ptr, size );
|
48
|
53
|
}
|
49
|
54
|
|
50
|
|
-/**
|
51
|
|
- * Allocate cleared memory
|
52
|
|
- *
|
53
|
|
- * @v nmemb Number of members
|
54
|
|
- * @v size Size of each member
|
55
|
|
- * @ret ptr Allocated memory
|
56
|
|
- *
|
57
|
|
- * Allocate memory as per malloc(), and zero it.
|
58
|
|
- *
|
59
|
|
- * Note that malloc() and calloc() are identical, in the interests of
|
60
|
|
- * reducing code size. Callers should not, however, rely on malloc()
|
61
|
|
- * clearing memory, since this behaviour may change in future.
|
62
|
|
- */
|
63
|
|
-static inline void * calloc ( size_t nmemb, size_t size ) {
|
64
|
|
- return malloc ( nmemb * size );
|
65
|
|
-}
|
66
|
|
-
|
67
|
55
|
#endif /* _MALLOC_H */
|