lambda-calc-1/value/free.c
2025-01-13 20:36:07 -06:00

25 lines
396 B
C

#include <stdlib.h>
#include <assert.h>
#include <debug.h>
#include "struct.h"
#include "inheritance.h"
#include "free.h"
void free_value(
struct value* this)
{
if (this && !--this->refcount)
{
assert(this);
assert(this->inheritance);
assert(this->inheritance->free);
(this->inheritance->free)(this);
free(this);
}
}