Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
| Comment: | merge trunk. Undo unnecessary changes in tclEncoding.c, making it equal to trunk again (thanks to Christian Werner for testing this on androidwish). |
|---|---|
| Timelines: | family | ancestors | descendants | both | androwish |
| Files: | files | file ages | folders |
| SHA1: |
f0ca2a62232fe92f0e21cdb567a4b622 |
| User & Date: | jan.nijtmans 2015-07-15 14:52:25.468 |
Context
|
2015-07-16
| ||
| 05:31 | merge trunk check-in: 9fb3171f6d user: jan.nijtmans tags: androwish | |
|
2015-07-15
| ||
| 14:52 | merge trunk. Undo unnecessary changes in tclEncoding.c, making it equal to trunk again (thanks to Ch... check-in: f0ca2a6223 user: jan.nijtmans tags: androwish | |
| 14:47 | Increase some counter sizes related to filesystem epoch from int to size_t. And prevent them ever be... check-in: 5a8e195a32 user: jan.nijtmans tags: trunk | |
| 09:31 | Remove unused local variables. Now unix/tclUnixTime.c is idential in "androwish" compared to "novem"... check-in: 59e576c1f2 user: jan.nijtmans tags: androwish | |
Changes
Changes to generic/tclEncoding.c.
| ︙ | ︙ | |||
492 493 494 495 496 497 498 |
* entries found, we favor files earlier on the search path.
*/
int j, numFiles;
Tcl_Obj *directory, *matchFileList = Tcl_NewObj();
Tcl_Obj **filev;
Tcl_GlobTypeData readableFiles = {
| < < < < < < < < < < | 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 |
* entries found, we favor files earlier on the search path.
*/
int j, numFiles;
Tcl_Obj *directory, *matchFileList = Tcl_NewObj();
Tcl_Obj **filev;
Tcl_GlobTypeData readableFiles = {
TCL_GLOB_TYPE_FILE, TCL_GLOB_PERM_R, NULL, NULL
};
Tcl_ListObjIndex(NULL, searchPath, i, &directory);
Tcl_IncrRefCount(directory);
Tcl_IncrRefCount(matchFileList);
Tcl_FSMatchInDirectory(NULL, matchFileList, directory, "*.enc",
&readableFiles);
Tcl_ListObjGetElements(NULL, matchFileList, &numFiles, &filev);
for (j=0; j<numFiles; j++) {
Tcl_Obj *encodingName, *fileObj;
fileObj = TclPathPart(NULL, filev[j], TCL_PATH_TAIL);
encodingName = TclPathPart(NULL, fileObj, TCL_PATH_ROOT);
Tcl_DictObjPut(NULL, map, encodingName, directory);
Tcl_DecrRefCount(fileObj);
Tcl_DecrRefCount(encodingName);
}
Tcl_DecrRefCount(matchFileList);
|
| ︙ | ︙ |
Changes to generic/tclFileSystem.h.
| ︙ | ︙ | |||
29 30 31 32 33 34 35 | Tcl_Obj *pathPtr, Tcl_Obj *cwdPtr); MODULE_SCOPE int TclFSEnsureEpochOk(Tcl_Obj *pathPtr, const Tcl_Filesystem **fsPtrPtr); MODULE_SCOPE void TclFSSetPathDetails(Tcl_Obj *pathPtr, const Tcl_Filesystem *fsPtr, ClientData clientData); MODULE_SCOPE Tcl_Obj * TclFSNormalizeAbsolutePath(Tcl_Interp *interp, Tcl_Obj *pathPtr); | | | 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | Tcl_Obj *pathPtr, Tcl_Obj *cwdPtr); MODULE_SCOPE int TclFSEnsureEpochOk(Tcl_Obj *pathPtr, const Tcl_Filesystem **fsPtrPtr); MODULE_SCOPE void TclFSSetPathDetails(Tcl_Obj *pathPtr, const Tcl_Filesystem *fsPtr, ClientData clientData); MODULE_SCOPE Tcl_Obj * TclFSNormalizeAbsolutePath(Tcl_Interp *interp, Tcl_Obj *pathPtr); MODULE_SCOPE size_t TclFSEpoch(void); /* * Private shared variables for use by tclIOUtil.c and tclPathObj.c */ MODULE_SCOPE const Tcl_Filesystem tclNativeFilesystem; |
| ︙ | ︙ | |||
51 52 53 54 55 56 57 | int *driveNameLengthPtr); MODULE_SCOPE Tcl_PathType TclFSNonnativePathType(const char *pathPtr, int pathLen, const Tcl_Filesystem **filesystemPtrPtr, int *driveNameLengthPtr, Tcl_Obj **driveNameRef); MODULE_SCOPE Tcl_PathType TclGetPathType(Tcl_Obj *pathPtr, const Tcl_Filesystem **filesystemPtrPtr, int *driveNameLengthPtr, Tcl_Obj **driveNameRef); | | | 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 | int *driveNameLengthPtr); MODULE_SCOPE Tcl_PathType TclFSNonnativePathType(const char *pathPtr, int pathLen, const Tcl_Filesystem **filesystemPtrPtr, int *driveNameLengthPtr, Tcl_Obj **driveNameRef); MODULE_SCOPE Tcl_PathType TclGetPathType(Tcl_Obj *pathPtr, const Tcl_Filesystem **filesystemPtrPtr, int *driveNameLengthPtr, Tcl_Obj **driveNameRef); MODULE_SCOPE int TclFSEpochOk(size_t filesystemEpoch); MODULE_SCOPE int TclFSCwdIsNative(void); MODULE_SCOPE Tcl_Obj * TclWinVolumeRelativeNormalize(Tcl_Interp *interp, const char *path, Tcl_Obj **useThisCwdPtr); MODULE_SCOPE Tcl_FSPathInFilesystemProc TclNativePathInFilesystem; MODULE_SCOPE Tcl_FSCreateInternalRepProc TclNativeCreateNativeRep; |
| ︙ | ︙ |
Changes to generic/tclIOUtil.c.
| ︙ | ︙ | |||
55 56 57 58 59 60 61 |
* private copies of some global data. This way we avoid most of the
* synchronization calls which boosts performance, at cost of having to update
* this information each time the corresponding epoch counter changes.
*/
typedef struct ThreadSpecificData {
int initialized;
| | | | | 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
* private copies of some global data. This way we avoid most of the
* synchronization calls which boosts performance, at cost of having to update
* this information each time the corresponding epoch counter changes.
*/
typedef struct ThreadSpecificData {
int initialized;
size_t cwdPathEpoch;
size_t filesystemEpoch;
Tcl_Obj *cwdPathPtr;
ClientData cwdClientData;
FilesystemRecord *filesystemList;
size_t claims;
} ThreadSpecificData;
/*
* Prototypes for functions defined later in this file.
*/
static int EvalFileCallback(ClientData data[],
|
| ︙ | ︙ | |||
215 216 217 218 219 220 221 | /* * This is incremented each time we modify the linked list of filesystems. Any * time it changes, all cached filesystem representations are suspect and must * be freed. For multithreading builds, change of the filesystem epoch will * trigger cache cleanup in all threads. */ | | | | 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 | /* * This is incremented each time we modify the linked list of filesystems. Any * time it changes, all cached filesystem representations are suspect and must * be freed. For multithreading builds, change of the filesystem epoch will * trigger cache cleanup in all threads. */ static size_t theFilesystemEpoch = 1; /* * Stores the linked list of filesystems. A 1:1 copy of this list is also * maintained in the TSD for each thread. This is to avoid synchronization * issues. */ static FilesystemRecord *filesystemList = &nativeFilesystemRecord; TCL_DECLARE_MUTEX(filesystemMutex) /* * Used to implement Tcl_FSGetCwd in a file-system independent way. */ static Tcl_Obj *cwdPathPtr = NULL; static size_t cwdPathEpoch = 0; static ClientData cwdClientData = NULL; TCL_DECLARE_MUTEX(cwdMutex) static Tcl_ThreadDataKey fsDataKey; /* * One of these structures is used each time we successfully load a file from |
| ︙ | ︙ | |||
645 646 647 648 649 650 651 | /* * The epoch can be changed both by filesystems being added or removed and by * env(HOME) changing. */ int TclFSEpochOk( | | | | 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 |
/*
* The epoch can be changed both by filesystems being added or removed and by
* env(HOME) changing.
*/
int
TclFSEpochOk(
size_t filesystemEpoch)
{
return (filesystemEpoch == 0 || filesystemEpoch == theFilesystemEpoch);
}
static void
Claim(void)
{
ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&fsDataKey);
tsdPtr->claims++;
}
static void
Disclaim(void)
{
ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&fsDataKey);
tsdPtr->claims--;
}
size_t
TclFSEpoch(void)
{
ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&fsDataKey);
return tsdPtr->filesystemEpoch;
}
|
| ︙ | ︙ | |||
713 714 715 716 717 718 719 |
*/
cwdPathPtr = Tcl_NewStringObj(str, len);
Tcl_IncrRefCount(cwdPathPtr);
cwdClientData = TclNativeDupInternalRep(clientData);
}
| > | > | 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 |
*/
cwdPathPtr = Tcl_NewStringObj(str, len);
Tcl_IncrRefCount(cwdPathPtr);
cwdClientData = TclNativeDupInternalRep(clientData);
}
if (++cwdPathEpoch == 0) {
++cwdPathEpoch;
}
tsdPtr->cwdPathEpoch = cwdPathEpoch;
Tcl_MutexUnlock(&cwdMutex);
if (tsdPtr->cwdPathPtr) {
Tcl_DecrRefCount(tsdPtr->cwdPathPtr);
}
if (tsdPtr->cwdClientData) {
|
| ︙ | ︙ | |||
791 792 793 794 795 796 797 |
if (fsRecPtr != &nativeFilesystemRecord) {
ckfree(fsRecPtr);
}
fsRecPtr = tmpFsRecPtr;
}
if (++theFilesystemEpoch == 0) {
| | | 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 |
if (fsRecPtr != &nativeFilesystemRecord) {
ckfree(fsRecPtr);
}
fsRecPtr = tmpFsRecPtr;
}
if (++theFilesystemEpoch == 0) {
++theFilesystemEpoch;
}
filesystemList = NULL;
/*
* Now filesystemList is NULL. This means that any attempt to use the
* filesystem is likely to fail.
*/
|
| ︙ | ︙ | |||
826 827 828 829 830 831 832 |
*/
void
TclResetFilesystem(void)
{
filesystemList = &nativeFilesystemRecord;
if (++theFilesystemEpoch == 0) {
| | | 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 |
*/
void
TclResetFilesystem(void)
{
filesystemList = &nativeFilesystemRecord;
if (++theFilesystemEpoch == 0) {
++theFilesystemEpoch;
}
#ifdef _WIN32
/*
* Cleans up the win32 API filesystem proc lookup table. This must happen
* very late in finalization so that deleting of copied dlls can occur.
*/
|
| ︙ | ︙ | |||
913 914 915 916 917 918 919 |
/*
* Increment the filesystem epoch counter, since existing paths might
* conceivably now belong to different filesystems.
*/
if (++theFilesystemEpoch == 0) {
| | | 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 |
/*
* Increment the filesystem epoch counter, since existing paths might
* conceivably now belong to different filesystems.
*/
if (++theFilesystemEpoch == 0) {
++theFilesystemEpoch;
}
Tcl_MutexUnlock(&filesystemMutex);
return TCL_OK;
}
/*
|
| ︙ | ︙ | |||
980 981 982 983 984 985 986 |
* might conceivably now belong to different filesystems. This
* should also ensure that paths which have cached the filesystem
* which is about to be deleted do not reference that filesystem
* (which would of course lead to memory exceptions).
*/
if (++theFilesystemEpoch == 0) {
| | | 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 |
* might conceivably now belong to different filesystems. This
* should also ensure that paths which have cached the filesystem
* which is about to be deleted do not reference that filesystem
* (which would of course lead to memory exceptions).
*/
if (++theFilesystemEpoch == 0) {
++theFilesystemEpoch;
}
ckfree(fsRecPtr);
retVal = TCL_OK;
} else {
fsRecPtr = fsRecPtr->nextPtr;
|
| ︙ | ︙ | |||
1313 1314 1315 1316 1317 1318 1319 |
/*
* Increment the filesystem epoch counter, since existing paths might now
* belong to different filesystems.
*/
Tcl_MutexLock(&filesystemMutex);
if (++theFilesystemEpoch == 0) {
| | | 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 |
/*
* Increment the filesystem epoch counter, since existing paths might now
* belong to different filesystems.
*/
Tcl_MutexLock(&filesystemMutex);
if (++theFilesystemEpoch == 0) {
++theFilesystemEpoch;
}
Tcl_MutexUnlock(&filesystemMutex);
}
/*
*----------------------------------------------------------------------
*
|
| ︙ | ︙ |