lisp-take-1/value/shallow_free.c

55 lines
982 B
C

#include <assert.h>
#include <debug.h>
#include "inheritance.h"
#include "struct.h"
#include "shallow_free.h"
void shallow_free_value(
struct value* this)
{
ENTER;
/* #ifdef VALGRIND_BUILD*/
/* if (!VALGRIND_CHECK_VALUE_IS_DEFINED(this))*/
/* {*/
/* TODO;*/
/* }*/
/* #endif*/
dpvp(this);
/* #ifdef VALGRIND_BUILD*/
/* if (!VALGRIND_CHECK_VALUE_IS_DEFINED(this->kind))*/
/* {*/
/* TODO;*/
/* }*/
/* #endif*/
dpvu(this->kind);
/* #ifdef VALGRIND_BUILD*/
/* if (!VALGRIND_CHECK_VALUE_IS_DEFINED(this->inheritance))*/
/* {*/
/* TODO;*/
/* }*/
/* #endif*/
dpvp(this->inheritance);
dpvp(this->inheritance->shallow_free);
assert(this);
assert(this->inheritance);
assert(this->inheritance->shallow_free);
(this->inheritance->shallow_free)(this);
// free(this);
// I don't free myself, GC does that.
EXIT;
}