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

27 lines
409 B
C

#include <debug.h>
#include <memory/smalloc.h>
#include "struct.h"
#include "new.h"
struct value* new_value(
enum value_kind kind,
const struct value_inheritance* inheritance,
size_t alloc_size)
{
ENTER;
struct value* this = smalloc(alloc_size);
this->kind = kind;
this->inheritance = inheritance;
this->refcount = 1;
EXIT;
return this;
}