From 60b3369ab24f9bd2a4a6d638ab1b3013ebc29814 Mon Sep 17 00:00:00 2001 From: ubq323 Date: Thu, 20 Jun 2024 16:00:34 +0100 Subject: pass State *S everywhere contains changes from a million years ago that i don't remember much about --- val.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'val.c') diff --git a/val.c b/val.c index 530737d..22c92ce 100644 --- a/val.c +++ b/val.c @@ -5,22 +5,22 @@ #include "ht.h" -ObjString *objstring_copy(char *src, size_t len) { - char *d = NEW_ARR(char, 1+len); +ObjString *objstring_copy(State *S, char *src, size_t len) { + char *d = NEW_ARR(S, char, 1+len); memcpy(d, src, len); d[len] = '\0'; - ObjString *o = NEW_OBJ(ObjString, OTY_STRING); + ObjString *o = NEW_OBJ(S, ObjString, OTY_STRING); o->len = len; - o->b = d; + o->d = d; o->hash = hash(d, len); return o; } -ObjString *objstring_take(char *src, size_t len) { - ObjString *o = NEW_OBJ(ObjString, OTY_STRING); +ObjString *objstring_take(State *S, char *src, size_t len) { + ObjString *o = NEW_OBJ(S, ObjString, OTY_STRING); o->len = len; - o->b = src; + o->d = src; o->hash = hash(src, len); return o; -- cgit v1.2.3