-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmemtools_memory_interface.h
33 lines (26 loc) · 1.24 KB
/
memtools_memory_interface.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
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* memtools_memory_interface.h * * * * * * * * * * * * * * * * * * * */
/* 6 august 2020 * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* jordan bonecutter * * * * * * * * * * * * * * * * * * * * * * * * */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#ifndef memtools_memory_interface_INCLUDE_GUARD
#define memtools_memory_interface_INCLUDE_GUARD
typedef struct{
unsigned int line;
uint8_t* memstart;
size_t n;
char **comments, *file, *alloc_type;
unsigned int n_comments;
}memtools_allocation;
typedef struct{
bool is_valid_ptr, shifted_ptr;
size_t n_bytes;
void* memstart;
}memtools_free_info;
typedef void* memtools_memory_interface;
memtools_memory_interface* memtools_memory_interface_create();
memtools_allocation* memtools_memory_interface_add_allocation(memtools_memory_interface**, size_t n);
memtools_allocation* memtools_memory_interface_get_allocation_for_pointer(memtools_memory_interface*, void*);
memtools_free_info memtools_memory_interface_destroy_allocation_by_pointer(memtools_memory_interface**, void*);
void memtools_memory_interface_for_each(memtools_memory_interface*, void (*for_each)(memtools_allocation*));
#endif