diff options
author | ubq323 <ubq323@ubq323.website> | 2024-06-20 16:00:34 +0100 |
---|---|---|
committer | ubq323 <ubq323@ubq323.website> | 2024-06-20 16:00:34 +0100 |
commit | 60b3369ab24f9bd2a4a6d638ab1b3013ebc29814 (patch) | |
tree | 3ff8ec7e95ef314266673b1b3d7bedb880a4a5b0 /val.c | |
parent | 9ee73a8459eb2bb58adc29da02de312b7e4e7dca (diff) |
pass State *S everywhere
contains changes from a million years ago that i don't remember much about
Diffstat (limited to 'val.c')
-rw-r--r-- | val.c | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -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; |