Tcl Source Code

Artifact [b0651fe174]
Login

Artifact b0651fe174028b7ea12b2bb22695e55a181bfec8:

Attachment "tclThreadAlloc.patch" to ticket [3613497fff] added by gneumann 2013-05-17 15:32:54.
--- tcl8.5.14/generic/tclThreadAlloc.c-orig	2013-05-17 09:42:05.000000000 +0200
+++ tcl8.5.14/generic/tclThreadAlloc.c	2013-05-17 10:05:06.000000000 +0200
@@ -281,7 +281,14 @@
  *
  *----------------------------------------------------------------------
  */
-
+#if defined(SYSTEM_MALLOC)
+char *
+TclpAlloc(
+    unsigned int numBytes)     /* Number of bytes to allocate. */
+{
+    return (char*) malloc(numBytes);
+}
+#else 
 char *
 TclpAlloc(
     unsigned int reqSize)
@@ -345,6 +352,7 @@
     }
     return Block2Ptr(blockPtr, bucket, reqSize);
 }
+#endif
 
 /*
  *----------------------------------------------------------------------
@@ -361,7 +369,15 @@
  *
  *----------------------------------------------------------------------
  */
-
+#if defined(SYSTEM_MALLOC)
+void
+TclpFree(
+    char *ptr)         /* Pointer to memory to free. */
+{
+    free(ptr);
+    return;
+}
+#else 
 void
 TclpFree(
     char *ptr)
@@ -404,6 +420,7 @@
 	PutBlocks(cachePtr, bucket, bucketInfo[bucket].numMove);
     }
 }
+#endif
 
 /*
  *----------------------------------------------------------------------
@@ -420,7 +437,15 @@
  *
  *----------------------------------------------------------------------
  */
-
+#if defined(SYSTEM_MALLOC)
+char *
+TclpRealloc(
+    char *oldPtr,              /* Pointer to alloced block. */
+    unsigned int numBytes)     /* New size of memory. */
+{
+    return realloc(oldPtr, numBytes);
+}
+#else
 char *
 TclpRealloc(
     char *ptr,
@@ -501,6 +526,7 @@
     }
     return newPtr;
 }
+#endif
 
 /*
  *----------------------------------------------------------------------