579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
|
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
|
-
+
-
+
|
* filename and line number corresponding to the caller. These are sent
* by the ckfree macro; it uses the preprocessor autodefines __FILE__ and
* __LINE__.
*
*----------------------------------------------------------------------
*/
int
void
Tcl_DbCkfree(
char *ptr,
CONST char *file,
int line)
{
struct mem_header *memp;
if (ptr == NULL) {
return 0;
return;
}
/*
* The following cast is *very* tricky. Must convert the pointer to an
* integer before doing arithmetic on it, because otherwise the arithmetic
* will be done differently (and incorrectly) on word-addressed machines
* such as Crays (will subtract only bytes, even though BODY_OFFSET is in
|
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
|
642
643
644
645
646
647
648
649
650
651
652
653
654
655
|
-
-
|
memp->blink->flink = memp->flink;
}
if (allocHead == memp) {
allocHead = memp->flink;
}
TclpFree((char *) memp);
Tcl_MutexUnlock(ckallocMutexPtr);
return 0;
}
/*
*--------------------------------------------------------------------
*
* Tcl_DbCkrealloc - debugging ckrealloc
*
|
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
|
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
|
-
+
-
|
void
Tcl_Free(
char *ptr)
{
TclpFree(ptr);
}
int
void
Tcl_DbCkfree(
char *ptr,
CONST char *file,
int line)
{
TclpFree(ptr);
return 0;
}
/*
*----------------------------------------------------------------------
*
* Tcl_InitMemory --
*
|