diff --git a/source/refstring.c b/source/refstring.c index cbc74f1..17c144e 100644 --- a/source/refstring.c +++ b/source/refstring.c @@ -57,17 +57,14 @@ int lengthRefString(RefString* refString) { } RefString* copyRefString(RefString* refString) { + //Cheaty McCheater Face refString->refcount++; return refString; } RefString* deepCopyRefString(RefString* refString) { - //deep copy, which can be modified immediately - RefString* newRefString = (RefString*)allocate(NULL, 0, sizeof(int) * 2 + refString->length + 1); - - memcpy(newRefString, refString, refString->length + 1); - - return newRefString; + //create a new string, with a new refcount + return createRefStringLength(refString->data, refString->length); } char* toCString(RefString* refString) { diff --git a/source/toy_common.h b/source/toy_common.h index 0adba45..1f5309d 100644 --- a/source/toy_common.h +++ b/source/toy_common.h @@ -6,7 +6,7 @@ #define TOY_VERSION_MAJOR 0 #define TOY_VERSION_MINOR 6 -#define TOY_VERSION_PATCH 3 +#define TOY_VERSION_PATCH 4 #define TOY_VERSION_BUILD __DATE__ " " __TIME__ //platform exports/imports