summaryrefslogtreecommitdiffstats
path: root/generic/tclCkalloc.c
diff options
context:
space:
mode:
authorsandeep <sandeep>2000-05-31 01:28:55 (GMT)
committersandeep <sandeep>2000-05-31 01:28:55 (GMT)
commitf5f35eb289ea0bbcc21f60746f10922fd20891ca (patch)
treed2cb7cd3e5ca0e90883c0d6aaa5f8471032e8557 /generic/tclCkalloc.c
parent492f9b8edd489f07ffd0741d0e9f23c0433334f9 (diff)
downloadtcl-f5f35eb289ea0bbcc21f60746f10922fd20891ca.zip
tcl-f5f35eb289ea0bbcc21f60746f10922fd20891ca.tar.gz
tcl-f5f35eb289ea0bbcc21f60746f10922fd20891ca.tar.bz2
2000-05-29 Sandeep Tamhankar <sandeep@scriptics.com>
* tests/http.test * doc/http.n * library/http2.3/http.tcl: Fixed bug 5741, where unsuccessful geturl calls sometimes leaked memory and resources (sockets). Also, switched around some of the logic so that http::wait never throws an exception. This is because in an asynchronous geturl, the command callback will probably end up doing all the error handling anyway, and in an asynchronous situation, the user expects to check the state when the transaction completes, as opposed to being thrown an exception. For the http package, this menas the user can check http::status for "error" and http::error for the error message after doing the http::wait.
Diffstat (limited to 'generic/tclCkalloc.c')
-rw-r--r--generic/tclCkalloc.c77
1 files changed, 22 insertions, 55 deletions
diff --git a/generic/tclCkalloc.c b/generic/tclCkalloc.c
index a85a0fd..a12f0cd 100644
--- a/generic/tclCkalloc.c
+++ b/generic/tclCkalloc.c
@@ -13,7 +13,7 @@
*
* This code contributed by Karl Lehenbauer and Mark Diekhans
*
- * RCS: @(#) $Id: tclCkalloc.c,v 1.8 2000/04/27 01:47:01 ericm Exp $
+ * RCS: @(#) $Id: tclCkalloc.c,v 1.7 1999/11/19 06:34:23 hobbs Exp $
*/
#include "tclInt.h"
@@ -179,34 +179,20 @@ TclDumpMemoryInfo(outFile)
maximum_bytes_malloced);
}
-
/*
*----------------------------------------------------------------------
*
* ValidateMemory --
- *
- * Validate memory guard zones for a particular chunk of allocated
- * memory.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Prints validation information about the allocated memory to stderr.
+ * Procedure to validate allocted memory guard zones.
*
*----------------------------------------------------------------------
*/
-
static void
ValidateMemory(memHeaderP, file, line, nukeGuards)
- struct mem_header *memHeaderP; /* Memory chunk to validate */
- char *file; /* File containing the call to
- * Tcl_ValidateAllMemory */
- int line; /* Line number of call to
- * Tcl_ValidateAllMemory */
- int nukeGuards; /* If non-zero, indicates that the
- * memory guards are to be reset to 0
- * after they have been printed */
+ struct mem_header *memHeaderP;
+ char *file;
+ int line;
+ int nukeGuards;
{
unsigned char *hiPtr;
int idx;
@@ -267,21 +253,14 @@ ValidateMemory(memHeaderP, file, line, nukeGuards)
*----------------------------------------------------------------------
*
* Tcl_ValidateAllMemory --
- *
- * Validate memory guard regions for all allocated memory.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Displays memory validation information to stderr.
+ * Validates guard regions for all allocated memory.
*
*----------------------------------------------------------------------
*/
void
Tcl_ValidateAllMemory (file, line)
- char *file; /* File from which Tcl_ValidateAllMemory was called */
- int line; /* Line number of call to Tcl_ValidateAllMemory */
+ char *file;
+ int line;
{
struct mem_header *memScanP;
@@ -299,18 +278,16 @@ Tcl_ValidateAllMemory (file, line)
*----------------------------------------------------------------------
*
* Tcl_DumpActiveMemory --
- *
- * Displays all allocated memory to a file; if no filename is given,
- * information will be written to stderr.
+ * Displays all allocated memory to stderr.
*
* Results:
- * Return TCL_ERROR if an error accessing the file occures, `errno'
- * will have the file error number left in it.
+ * Return TCL_ERROR if an error accessing the file occures, `errno'
+ * will have the file error number left in it.
*----------------------------------------------------------------------
*/
int
Tcl_DumpActiveMemory (fileName)
- char *fileName; /* Name of the file to write info to */
+ char *fileName;
{
FILE *fileP;
struct mem_header *memScanP;
@@ -620,14 +597,13 @@ Tcl_Realloc(ptr, size)
*----------------------------------------------------------------------
*
* MemoryCmd --
- * Implements the Tcl "memory" command, which provides Tcl-level
- * control of Tcl memory debugging information.
- * memory info
- * memory display
- * memory break_on_malloc count
- * memory trace_on_at_malloc count
- * memory trace on|off
- * memory validate on|off
+ * Implements the TCL memory command:
+ * memory info
+ * memory display
+ * break_on_malloc count
+ * trace_on_at_malloc count
+ * trace on|off
+ * validate on|off
*
* Results:
* Standard TCL results.
@@ -793,22 +769,13 @@ CheckmemCmd(clientData, interp, argc, argv)
*----------------------------------------------------------------------
*
* Tcl_InitMemory --
- *
- * Create the "memory" and "checkmem" commands in the given
- * interpreter.
- *
- * Results:
- * None.
- *
- * Side effects:
- * New commands are added to the interpreter.
+ * Initialize the memory command.
*
*----------------------------------------------------------------------
*/
-
void
Tcl_InitMemory(interp)
- Tcl_Interp *interp; /* Interpreter in which commands should be added */
+ Tcl_Interp *interp;
{
TclInitDbCkalloc();
Tcl_CreateCommand (interp, "memory", MemoryCmd, (ClientData) NULL,