-
Notifications
You must be signed in to change notification settings - Fork 1
/
mem.h
51 lines (35 loc) · 792 Bytes
/
mem.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
/*
MEM
mem.c handles memory management. In particular, it contains
functions that free memory that has been allocated via malloc.
Does any of this even work?
*/
#ifndef MEM_GUARD
#define MEM_GUARD
#include <stdio.h>
#include <stdlib.h>
#include "flags.h"
#include "objects.h"
#include "parse.h"
void free_memory(void);
/* lists */
typedef struct List_list List_list;
struct List_list {
List* list;
List_list* next;
};
void free_lists(void);
void free_list(List** list);
void append_to_lists(List* list);
/* envs */
typedef struct Env_list Env_list;
struct Env_list {
Env* env;
Env_list* next;
};
void free_envs(void);
void free_env(Env** env);
void free_frame(Frame** frame);
void append_to_envs(Env* env);
/* tokens freed in parse.c */
#endif