Tcl Source Code

Check-in [3bb4751c4e]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Converted the memcpy() calls in append operations to memmove() calls. This adds safety in the case of overlapping copies, and improves performance on some benchmarks.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 3bb4751c4e460196baa3543897574da78a0de299
User & Date: dgp 2012-02-09 15:23:09
Context
2012-02-10
15:11
Document, by a retroactive bug report, a nasty Notifier issue on 64-bits x86 that affects the 8.4 br... check-in: 38c3b80088 user: ferrieux tags: trunk
2012-02-09
15:28
merge trunk check-in: 2b01c45c26 user: dkf tags: dkf-alias-encoding
15:28
merge trunk check-in: 2ee17eeb36 user: dkf tags: dkf-utf16-branch
15:28
merge trunk check-in: 8db26d2e11 user: dkf tags: dkf-notifier-poll
15:23
Converted the memcpy() calls in append operations to memmove() calls. This adds safety in the case o... check-in: 3bb4751c4e user: dgp tags: trunk
15:00
3484402 Correct Off-By-One error appending unicode. Thanks to Poor Yorick. Also corrected test for w... check-in: f43b43900f user: dgp tags: core-8-5-branch
2012-02-06
19:12
Honor per-namespace compile suppression in ensemble subcommands. check-in: ecbee70832 user: dgp tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to ChangeLog.







1
2
3
4
5
6
7






2012-02-06  Don Porter  <[email protected]>

	* generic/tclEnsemble.c: [Bug 3485022] TclCompileEnsemble() avoid
	* tests/trace.test:	compile when exec traces set.

2012-02-06  Miguel Sofer  <[email protected]>

>
>
>
>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
2012-02-09  Don Porter  <[email protected]>

	* generic/tclStringObj.c:	Converted the memcpy() calls in 
	append operations to memmove() calls.  This adds safety in the case
	of overlapping copies, and improves performance on some benchmarks.

2012-02-06  Don Porter  <[email protected]>

	* generic/tclEnsemble.c: [Bug 3485022] TclCompileEnsemble() avoid
	* tests/trace.test:	compile when exec traces set.

2012-02-06  Miguel Sofer  <[email protected]>

Changes to generic/tclStringObj.c.

1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
    }

    /*
     * Copy the new string onto the end of the old string, then add the
     * trailing null.
     */

    memcpy(stringPtr->unicode + stringPtr->numChars, unicode,
	    appendNumChars * sizeof(Tcl_UniChar));
    stringPtr->unicode[numChars] = 0;
    stringPtr->numChars = numChars;
    stringPtr->allocated = 0;

    TclInvalidateStringRep(objPtr);
}







|







1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
    }

    /*
     * Copy the new string onto the end of the old string, then add the
     * trailing null.
     */

    memmove(stringPtr->unicode + stringPtr->numChars, unicode,
	    appendNumChars * sizeof(Tcl_UniChar));
    stringPtr->unicode[numChars] = 0;
    stringPtr->numChars = numChars;
    stringPtr->allocated = 0;

    TclInvalidateStringRep(objPtr);
}
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
    /*
     * Invalidate the unicode data.
     */

    stringPtr->numChars = -1;
    stringPtr->hasUnicode = 0;

    memcpy(objPtr->bytes + oldLength, bytes, numBytes);
    objPtr->bytes[newLength] = 0;
    objPtr->length = newLength;
}

/*
 *----------------------------------------------------------------------
 *







|







1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
    /*
     * Invalidate the unicode data.
     */

    stringPtr->numChars = -1;
    stringPtr->hasUnicode = 0;

    memmove(objPtr->bytes + oldLength, bytes, numBytes);
    objPtr->bytes[newLength] = 0;
    objPtr->length = newLength;
}

/*
 *----------------------------------------------------------------------
 *