summaryrefslogtreecommitdiffstats
path: root/generic/tclThreadAlloc.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2017-11-16 11:17:54 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2017-11-16 11:17:54 (GMT)
commit5534478fa10a116663a3b05f32a119bb07aa9ed2 (patch)
treeb647149ae02bb75b31d2ac1b36cbd503bf42855c /generic/tclThreadAlloc.c
parentde0ff2272ed178a1fba979435ced086cecb968fa (diff)
parent7dec4a7fc516a50bac5f55f6752b646254ba1082 (diff)
downloadtcl-5534478fa10a116663a3b05f32a119bb07aa9ed2.zip
tcl-5534478fa10a116663a3b05f32a119bb07aa9ed2.tar.gz
tcl-5534478fa10a116663a3b05f32a119bb07aa9ed2.tar.bz2
re-base "novem-more-memory-API" to trunk. TIP not submitted yet, but upcoming.
Diffstat (limited to 'generic/tclThreadAlloc.c')
-rw-r--r--generic/tclThreadAlloc.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/generic/tclThreadAlloc.c b/generic/tclThreadAlloc.c
index 8077de4..968320c 100644
--- a/generic/tclThreadAlloc.c
+++ b/generic/tclThreadAlloc.c
@@ -211,7 +211,7 @@ GetCache(void)
cachePtr = TclpGetAllocCache();
if (cachePtr == NULL) {
- cachePtr = TclpSysAlloc(sizeof(Cache), 0);
+ cachePtr = TclpSysAlloc(sizeof(Cache));
if (cachePtr == NULL) {
Tcl_Panic("alloc: could not allocate new cache");
}
@@ -299,9 +299,9 @@ TclFreeAllocCache(
*----------------------------------------------------------------------
*/
-char *
+void *
TclpAlloc(
- unsigned int reqSize)
+ size_t reqSize)
{
Cache *cachePtr;
Block *blockPtr;
@@ -314,7 +314,7 @@ TclpAlloc(
const size_t zero = 0;
const size_t max = ~zero;
- if (((size_t) reqSize) > max - sizeof(Block) - RCHECK) {
+ if (reqSize > max - sizeof(Block) - RCHECK) {
/* Requested allocation exceeds memory */
return NULL;
}
@@ -337,7 +337,7 @@ TclpAlloc(
#endif
if (size > MAXALLOC) {
bucket = NBUCKETS;
- blockPtr = TclpSysAlloc(size, 0);
+ blockPtr = TclpSysAlloc(size);
if (blockPtr != NULL) {
cachePtr->totalAssigned += reqSize;
}
@@ -378,7 +378,7 @@ TclpAlloc(
void
TclpFree(
- char *ptr)
+ void *ptr)
{
Cache *cachePtr;
Block *blockPtr;
@@ -435,10 +435,10 @@ TclpFree(
*----------------------------------------------------------------------
*/
-char *
+void *
TclpRealloc(
- char *ptr,
- unsigned int reqSize)
+ void *ptr,
+ size_t reqSize)
{
Cache *cachePtr;
Block *blockPtr;
@@ -456,7 +456,7 @@ TclpRealloc(
const size_t zero = 0;
const size_t max = ~zero;
- if (((size_t) reqSize) > max - sizeof(Block) - RCHECK) {
+ if ((reqSize) > max - sizeof(Block) - RCHECK) {
/* Requested allocation exceeds memory */
return NULL;
}
@@ -563,7 +563,7 @@ TclThreadAllocObj(void)
Tcl_Obj *newObjsPtr;
cachePtr->numObjects = numMove = NOBJALLOC;
- newObjsPtr = TclpSysAlloc(sizeof(Tcl_Obj) * numMove, 0);
+ newObjsPtr = TclpSysAlloc(sizeof(Tcl_Obj) * numMove);
if (newObjsPtr == NULL) {
Tcl_Panic("alloc: could not allocate %d new objects", numMove);
}
@@ -1032,7 +1032,7 @@ GetBlocks(
if (blockPtr == NULL) {
size = MAXALLOC;
- blockPtr = TclpSysAlloc(size, 0);
+ blockPtr = TclpSysAlloc(size);
if (blockPtr == NULL) {
return 0;
}