mie: implement caching and emitting string data

This commit is contained in:
2025-04-17 22:55:17 +01:00
parent abb7cfaf0e
commit 9cce4bf541
11 changed files with 211 additions and 58 deletions

View File

@@ -2,6 +2,22 @@
#include <stdlib.h>
#include <string.h>
struct mie_const *mie_const_create(struct mie_type *type)
{
struct mie_const *c = malloc(sizeof *c);
if (!c) {
return NULL;
}
memset(c, 0x0, sizeof *c);
mie_value_init(&c->c_base, MIE_VALUE_CONST);
c->c_type = type;
return c;
}
static struct mie_type *get_type(struct mie_value *v)
{
struct mie_const *c = MIE_CONST(v);