XenevaOS
Loading...
Searching...
No Matches
kmalloc.h
Go to the documentation of this file.
1
30#ifndef _KMALLOC_H
31#define _KMALLOC_H
32
33#include <stdint.h>
34#if defined(__GNUC__) || defined(__clang__)
35#ifndef __cplusplus
36#include <stdbool.h>
37#endif
38#endif
39#include <aurora.h>
40
41
42#ifdef __cplusplus
43extern "C" {
44#endif
45 /*
46 * AuHeapInitialize -- initialize
47 * kernel malloc library with initial pages
48 */
49 void AuHeapInitialize();
50
51 AU_EXTERN AU_EXPORT void *kmalloc(unsigned int); //< The standard function.
52 AU_EXTERN AU_EXPORT void *krealloc(void *, unsigned int); //< The standard function.
53 AU_EXTERN AU_EXPORT void *kcalloc(size_t, size_t); //< The standard function.
54 AU_EXTERN AU_EXPORT void kfree(void *); //< The standard function.
55 extern void kheap_debug();
56 extern void kmalloc_debug_on(bool bit);
57#ifdef __XENEVA_DEBUG_ALLOC__
58 /* Stage 2 (debug-only): dump live heap blocks grouped by caller. */
59 extern void kheap_leak_dump();
60 /* Stage 2 deliberate-bug tests on a scratch pool (alloc_test.c). */
61 extern void AuAllocDebugTest();
62#endif
63
64#ifdef __cplusplus
65}
66#endif
67
68#endif
69
70
#define AU_EXTERN
Definition aurora.h:54
#define AU_EXPORT
Definition aurora.h:40
void kfree(void)
void kmalloc_debug_on(bool bit)
Definition kmalloc.cpp:450
void kheap_debug()
Definition kmalloc.cpp:263
void AuHeapInitialize()
Definition kmalloc.cpp:57
#define kmalloc(size, flags)
Definition slab.h:123
#define kcalloc(n, size,...)
Definition slab.h:153
#define krealloc(ptr, size,...)
Definition slab.h:180