Provisionally switched the memory allocation definitions away from

Tcl_Alloc() and Tcl_Free() because Tcl_Alloc() uses (unsigned int)
for the argument type and therefore limits memory allocations to
what can fit in 32 bits.  Using the system malloc(size_t) should not
cause any issues.
This commit is contained in:
Tim Edwards 2020-08-11 16:50:26 -04:00
parent 18131e26b3
commit 0df5f6d073
2 changed files with 11 additions and 3 deletions

View File

@ -1 +1 @@
8.3.49
8.3.50

View File

@ -74,8 +74,16 @@ static char *freeDelayedItem = NULL;
#define MallocRoutine(a) ckalloc(a)
#define FreeRoutine(a) ckfree(a)
#else
#define MallocRoutine(a) Tcl_Alloc(a)
#define FreeRoutine(a) Tcl_Free(a)
/* DO NOT USE: Tcl_Alloc is defined with argument (unsigned int) NOT
* (size_t) and therefore limits memory allocation to the size of a
* 32-bit integer. Just use the normal malloc() and free(). Left as-is
* with TCL_MEM_DEBUG with the caveat that one should not use this to
* debug a huge design. Valgrind works better anyway.
*/
/* #define MallocRoutine(a) Tcl_Alloc(a) */
/* #define FreeRoutine(a) Tcl_Free(a) */
#define MallocRoutine(a) malloc(a)
#define FreeRoutine(a) free(a)
#endif
#else
#define MallocRoutine(a) malloc(a)