forked from sachinites/LinuxMemoryManager
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuapi_mm_old.h
65 lines (54 loc) · 1.97 KB
/
uapi_mm_old.h
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/*
* =====================================================================================
*
* Filename: uapi_mm.h
*
* Description: This Header file ocntains public APIs to be used by the application
*
* Version: 1.0
* Created: 02/01/2020 10:00:27 PM
* Revision: none
* Compiler: gcc
*
* Author: Er. Abhishek Sagar, Juniper Networks (https://csepracticals.wixsite.com/csepracticals), sachinites@gmail.com
* Company: Juniper Networks
*
* This file is part of the Linux Memory Manager distribution (https://github.com/sachinites)
* Copyright (c) 2019 Abhishek Sagar.
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU General
* Public License as published by the Free Software Foundation, version 3.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* visit website : https://csepracticals.wixsite.com/csepracticals for more courses and projects
*
* =====================================================================================
*/
#ifndef __UAPI_MM__
#define __UAPI_MM__
#include <stdint.h>
void *
xcalloc(char *struct_name, int units);
void
xfree(void *app_ptr);
/*Printing Functions*/
void mm_print_memory_usage();
void mm_print_block_usage();
/*Initialization Functions*/
void
mm_init();
/*Registration function*/
void
mm_instantiate_new_page_family(
char *struct_name,
uint32_t struct_size);
#define XCALLOC(units, struct_name) \
(calloc(units, sizeof(struct_name)))
#define MM_REG_STRUCT(struct_name) \
(mm_instantiate_new_page_family(#struct_name, sizeof(struct_name)))
#define XFREE(ptr) \
free(ptr)
#endif /* __UAPI_MM__ */