-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmemory.h
More file actions
32 lines (25 loc) · 752 Bytes
/
Copy pathmemory.h
File metadata and controls
32 lines (25 loc) · 752 Bytes
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
#include "array.h"
#include "interpreter.h"
/*
* The module for management the memory allocations for Viper's data
*/
#ifndef VIPER_V4_MEMORY_H
#define VIPER_V4_MEMORY_H
/* Memory table element */
typedef struct MemoryElement {
void * address;
char type_id;
char * type;
char * owner;
char * meta;
int is_freed;
} MemoryElement;
/* Create new memory element */
MemoryElement * new_memory_element(char type_id, void * address, char * owner);
/* Display the memory table */
void display_memory_table(Array ** memory_table);
/* Destroy the all allocated data */
void garbage_destructor(Array ** memory_table);
/* Memory element destructor */
void memory_table_destructor(Array ** memory_table);
#endif //VIPER_V4_MEMORY_H