summaryrefslogtreecommitdiff
path: root/val.c
diff options
context:
space:
mode:
Diffstat (limited to 'val.c')
-rw-r--r--val.c14
1 files changed, 7 insertions, 7 deletions
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;