lisp-take-1/value/new.c

30 lines
464 B
C

#include <assert.h>
#include <debug.h>
#include <gc/allocate_node.h>
#include <gc/linked_list/clear.h>
#include "struct.h"
#include "new.h"
struct value* new_value(
struct gc* gc,
enum value_kind kind,
const struct value_inheritance* inheritance)
{
ENTER;
assert(inheritance);
struct value* this = gc_allocate_node(gc);
this->kind = kind;
this->inheritance = inheritance;
EXIT;
return this;
}