1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
33
45
46
47
48
49
50
51
52
53
54
55
56
57
/* ... */
#ifndef _K_MEM_H
#define _K_MEM_H
#ifdef __cplusplus
extern "C" {
#endif
#include "main.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
Includes
#define SIZE_OF_PAGE 1024
#define MAX_PAGE_NUMBER 64
typedef struct
{
uint32_t mallocBase;
uint32_t size[MAX_PAGE_NUMBER];
uint8_t PageTable[MAX_PAGE_NUMBER];
...}
mem_TypeDef;Exported types
void k_MemInit(void);
void * k_malloc(size_t s);
void k_free(void * p);
#ifdef __cplusplus
}extern "C" { ... }
#endif
/* ... */
#endif