#include "includes/gcollector.h"
int main(void)
{
void *ptr;
// gc_new(100); - gc malloc bucket environnement start size
ptr = galloc(100);
// ptr = 0xMEMADDR;
gfree(ptr);
// ptr = 0;
for (int i = 0; i < 100; i++)
ptr = galloc(100);
gc_destroy();
}
int main(void)
{
void *ptr;
// gc_new(100); - gc malloc bucket environnement start size
ptr = galloc(100);
// ptr = 0xMEMADDR;
gree(ptr);
// ptr = 0xMEMADDR;
for (int i = 0; i < 100; i++)
ptr = galloc(100);
gc_destroy();
}
#include "includes/gcollector.h"
view_hashtable
// free mem, destroy node and set *ptr to 0.
bool gfree(void **ptr);
// free mem, destroy node.
bool gree(void *ptr);
// allocate mem, create node.
void *galloc(size_t size);
t_hashtable *gc_new(unsigned int size);
bool gc_destroy(void);
t_hashtable **gc_anchor(void);
bool gc_anchor_exist(void);