181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
|
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
|
-
+
-
+
|
"current packets allocated %10d\n"
"current bytes allocated %10lu\n"
"maximum packets allocated %10d\n"
"maximum bytes allocated %10lu\n",
total_mallocs,
total_frees,
current_malloc_packets,
current_bytes_malloced,
(unsigned long)current_bytes_malloced,
maximum_malloc_packets,
maximum_bytes_malloced);
(unsigned long)maximum_bytes_malloced);
if (flags == 0) {
fprintf((FILE *)clientData, "%s", buf);
} else {
/* Assume objPtr to append to */
Tcl_AppendToObj((Tcl_Obj *) clientData, buf, -1);
}
return 1;
|
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
|
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
|
-
+
-
+
|
return TCL_OK;
}
if (strcmp(argv[1],"info") == 0) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"%-25s %10d\n%-25s %10d\n%-25s %10d\n%-25s %10lu\n%-25s %10d\n%-25s %10lu\n",
"total mallocs", total_mallocs, "total frees", total_frees,
"current packets allocated", current_malloc_packets,
"current bytes allocated", current_bytes_malloced,
"current bytes allocated", (unsigned long)current_bytes_malloced,
"maximum packets allocated", maximum_malloc_packets,
"maximum bytes allocated", maximum_bytes_malloced));
"maximum bytes allocated", (unsigned long)maximum_bytes_malloced));
return TCL_OK;
}
if (strcmp(argv[1],"init") == 0) {
if (argc != 3) {
goto bad_suboption;
}
init_malloced_bodies = (strcmp(argv[2],"on") == 0);
|