summaryrefslogtreecommitdiffstats
path: root/generic/tclInt.h
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2014-05-01 14:52:13 (GMT)
committerdgp <dgp@users.sourceforge.net>2014-05-01 14:52:13 (GMT)
commitab0e4b9897d95d1c3f643524a08c99425055ea5e (patch)
tree054b1a32984f0bd512dcdf3a4a778311fea392db /generic/tclInt.h
parenta777eef5bbacd8802c32ce467ee9bb989486f122 (diff)
parentcf5a2fcdb5b8dd834e530641922f7ba5c841553f (diff)
downloadtcl-ab0e4b9897d95d1c3f643524a08c99425055ea5e.zip
tcl-ab0e4b9897d95d1c3f643524a08c99425055ea5e.tar.gz
tcl-ab0e4b9897d95d1c3f643524a08c99425055ea5e.tar.bz2
merge 8.5
Diffstat (limited to 'generic/tclInt.h')
-rw-r--r--generic/tclInt.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/generic/tclInt.h b/generic/tclInt.h
index bb04a38..b30650d 100644
--- a/generic/tclInt.h
+++ b/generic/tclInt.h
@@ -3672,6 +3672,24 @@ MODULE_SCOPE void TclDbInitNewObj(Tcl_Obj *objPtr, CONST char *file,
/*
*----------------------------------------------------------------
+ * Macro that encapsulates the logic that determines when it is safe to
+ * interpret a string as a byte array directly. In summary, the object must be
+ * a byte array and must not have a string representation (as the operations
+ * that it is used in are defined on strings, not byte arrays). Theoretically
+ * it is possible to also be efficient in the case where the object's bytes
+ * field is filled by generation from the byte array (c.f. list canonicality)
+ * but we don't do that at the moment since this is purely about efficiency.
+ * The ANSI C "prototype" for this macro is:
+ *
+ * MODULE_SCOPE int TclIsPureByteArray(Tcl_Obj *objPtr);
+ *----------------------------------------------------------------
+ */
+
+#define TclIsPureByteArray(objPtr) \
+ (((objPtr)->typePtr==&tclByteArrayType) && ((objPtr)->bytes==NULL))
+
+/*
+ *----------------------------------------------------------------
* Macro used by the Tcl core to compare Unicode strings. On big-endian
* systems we can use the more efficient memcmp, but this would not be
* lexically correct on little-endian systems. The ANSI C "prototype" for