diff options
author | dgp <dgp@users.sourceforge.net> | 2014-05-16 14:47:15 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2014-05-16 14:47:15 (GMT) |
commit | 6f8a00dcd5a10e71caf9e3d2f7067523c4ff0b28 (patch) | |
tree | 7d22c170916773ed8248dc5d4b42f9caaa291baf /generic/tclInt.h | |
parent | 4830ed53a3b546ff699230e332c0a6d4fecf5a24 (diff) | |
parent | eb476fdf9350b70cf8ab1ec90ad848dec9d1b75b (diff) | |
download | tcl-6f8a00dcd5a10e71caf9e3d2f7067523c4ff0b28.zip tcl-6f8a00dcd5a10e71caf9e3d2f7067523c4ff0b28.tar.gz tcl-6f8a00dcd5a10e71caf9e3d2f7067523c4ff0b28.tar.bz2 |
Merge completion of dgp-read-bytes branch.
Diffstat (limited to 'generic/tclInt.h')
-rw-r--r-- | generic/tclInt.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/generic/tclInt.h b/generic/tclInt.h index 74a2ded..b30650d 100644 --- a/generic/tclInt.h +++ b/generic/tclInt.h @@ -2552,6 +2552,7 @@ MODULE_SCOPE void TclFinalizeObjects(void); MODULE_SCOPE void TclFinalizePreserve(void); MODULE_SCOPE void TclFinalizeSynchronization(void); MODULE_SCOPE void TclFinalizeThreadAlloc(void); +MODULE_SCOPE void TclFinalizeThreadAllocThread(void); MODULE_SCOPE void TclFinalizeThreadData(void); MODULE_SCOPE void TclFinalizeThreadObjects(void); MODULE_SCOPE double TclFloor(mp_int *a); @@ -3671,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 |