summaryrefslogtreecommitdiffstats
path: root/generic/tclEncoding.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2013-01-29 10:46:44 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2013-01-29 10:46:44 (GMT)
commitf9c71d451ebcc045cddff69484eb2bbe3c4eb312 (patch)
treece2ac1730893423bb06e66cdeb9ba071c37ace52 /generic/tclEncoding.c
parent38de96ca81b0ff5e34b5d653195a2412a66410dc (diff)
downloadtcl-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/tclEncoding.c')
-rw-r--r--generic/tclEncoding.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/generic/tclEncoding.c b/generic/tclEncoding.c
index eb4950a..a27bb5f 100644
--- a/generic/tclEncoding.c
+++ b/generic/tclEncoding.c
@@ -271,7 +271,7 @@ static int Iso88591ToUtfProc(ClientData clientData,
int *dstCharsPtr);
/*
- * A Tcl_ObjType for holding a cached Tcl_Encoding in the otherValuePtr field
+ * A Tcl_ObjType for holding a cached Tcl_Encoding in the twoPtrValue.ptr1 field
* of the intrep. This should help the lifetime of encodings be more useful.
* See concerns raised in [Bug 1077262].
*/
@@ -313,7 +313,8 @@ Tcl_GetEncodingFromObj(
return TCL_ERROR;
}
TclFreeIntRep(objPtr);
- objPtr->internalRep.otherValuePtr = (VOID *) encoding;
+ objPtr->internalRep.twoPtrValue.ptr1 = (VOID *) encoding;
+ objPtr->internalRep.twoPtrValue.ptr2 = NULL;
objPtr->typePtr = &encodingType;
}
*encodingPtr = Tcl_GetEncoding(NULL, name);
@@ -334,7 +335,7 @@ static void
FreeEncodingIntRep(
Tcl_Obj *objPtr)
{
- Tcl_FreeEncoding((Tcl_Encoding) objPtr->internalRep.otherValuePtr);
+ Tcl_FreeEncoding((Tcl_Encoding) objPtr->internalRep.twoPtrValue.ptr1);
objPtr->typePtr = NULL;
}
@@ -353,7 +354,7 @@ DupEncodingIntRep(
Tcl_Obj *srcPtr,
Tcl_Obj *dupPtr)
{
- dupPtr->internalRep.otherValuePtr = (VOID *)
+ dupPtr->internalRep.twoPtrValue.ptr1 = (VOID *)
Tcl_GetEncoding(NULL, srcPtr->bytes);
}