diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2013-01-29 10:46:44 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2013-01-29 10:46:44 (GMT) |
commit | f9c71d451ebcc045cddff69484eb2bbe3c4eb312 (patch) | |
tree | ce2ac1730893423bb06e66cdeb9ba071c37ace52 /generic/tclStringObj.c | |
parent | 38de96ca81b0ff5e34b5d653195a2412a66410dc (diff) | |
download | tcl-f9c71d451ebcc045cddff69484eb2bbe3c4eb312.zip tcl-f9c71d451ebcc045cddff69484eb2bbe3c4eb312.tar.gz tcl-f9c71d451ebcc045cddff69484eb2bbe3c4eb312.tar.bz2 |
Change core to use repr->twoPtrValue.ptr1 in stead of repr->otherValuePtr (which is exactly the same), but also set repr->twoPtrValue.ptr2 to NULL explicitly.
This allows repr->twoPtrValue.ptr2 to be used for another purpose (experimental): Store the StringObj internal representation there when available.
Diffstat (limited to 'generic/tclStringObj.c')
-rw-r--r-- | generic/tclStringObj.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/generic/tclStringObj.c b/generic/tclStringObj.c index 3f243a6..e2b9c22 100644 --- a/generic/tclStringObj.c +++ b/generic/tclStringObj.c @@ -128,9 +128,11 @@ typedef struct String { (String *) attemptckrealloc((char *) ptr, \ (unsigned) STRING_SIZE(STRING_UALLOC(numChars)) ) #define GET_STRING(objPtr) \ - ((String *) (objPtr)->internalRep.otherValuePtr) -#define SET_STRING(objPtr, stringPtr) \ - ((objPtr)->internalRep.otherValuePtr = (void *) (stringPtr)) + ((String *) (objPtr)->internalRep.twoPtrValue.ptr1) +#define SET_STRING(objPtr, stringPtr) do { \ + (objPtr)->internalRep.twoPtrValue.ptr2 = NULL; \ + (objPtr)->internalRep.twoPtrValue.ptr1 = (void *) (stringPtr); \ + } while(0) /* * TCL STRING GROWTH ALGORITHM |