-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathGC.h
More file actions
34 lines (24 loc) · 666 Bytes
/
GC.h
File metadata and controls
34 lines (24 loc) · 666 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
33
34
struct entry_s {
void* pointer;
int counter;
struct entry_s *next;
};
typedef struct entry_s entry_t;
struct hashtable_s {
int size;
entry_t** table;
};
typedef struct hashtable_s hashtable_t;
hashtable_t *ht_create( int size );
int ht_hash( hashtable_t *hashtable, void* pointer );
entry_t *ht_newpair( void* pointer );
hashtable_t *GC_hashtable;
void GC_start();
void GC_quit();
entry_t* GC_get_entry( void* pointer );
void GC_add_entry( entry_t* e);
void GC_new( void* pointer );
void* GC( void* pointer );
int GC_count( void* pointer );
void* GC_malloc( int length, int size );
int GC_free(void* pointer);