-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMemoryManager.h
More file actions
54 lines (37 loc) · 1.32 KB
/
MemoryManager.h
File metadata and controls
54 lines (37 loc) · 1.32 KB
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
//#pragma once
#ifndef __MEMORY_MANAGER_H__
#define __MEMORY_MANAGER_H__
// IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT
//
// DO NOT CHANGE THIS HEADER FILE
//
// IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT
namespace MemoryManager
{
void memView(int start, int end);
//---
//--- CORE Functions, these will need to be completed by the applicant
//---
// Initialize any data needed to manage the memory pool
void initializeMemoryManager(void);
// return a pointer inside the memory pool
// If no chunk can accommodate aSize call onOutOfMemory
void* allocate(int aSize);
// Free up a chunk previously allocated
void deallocate(void* aPointer);
int size(void *);
//---
//--- support routines
//---
// Will scan the memory pool and return the total free space remaining
int freeMemory(void);
// Will scan the memory pool and return the total used memory - memory that has been deallocated
int usedMemory(void);
// Will scan the memory pool and return the total in use memory - memory being curretnly used
int inUseMemory(void);
// Call if no space is left for the allocation request
void onOutOfMemory(void);
void traverseInUse(void);
void traverseUsed(void);
};
#endif // __MEMORY_MANAGER_H__