lambda-calculus/environment/free.c
2025-01-13 20:36:07 -06:00

27 lines
361 B
C

#include <stdlib.h>
#include <debug.h>
#include <extern/avl/avl.h>
#include "struct.h"
#include "free.h"
void free_environment(
struct environment* this)
{
ENTER;
if (this && !--this->refcount)
{
free_environment(this->fallback);
avl_free_tree(this->tree);
free(this);
}
EXIT;
}