comparison src/free-hook.c @ 396:6719134a07c2 r21-2-13

Import from CVS: tag r21-2-13
author cvs
date Mon, 13 Aug 2007 11:12:05 +0200
parents bbff43aa5eb7
children 74fd4e045ea6
comparison
equal deleted inserted replaced
395:de2c2a7459d2 396:6719134a07c2
416 #if defined(DEBUG_INPUT_BLOCKING) || defined (DEBUG_GCPRO) 416 #if defined(DEBUG_INPUT_BLOCKING) || defined (DEBUG_GCPRO)
417 417
418 /* Note: There is no more input blocking in XEmacs */ 418 /* Note: There is no more input blocking in XEmacs */
419 typedef enum { 419 typedef enum {
420 block_type, unblock_type, totally_type, 420 block_type, unblock_type, totally_type,
421 gcpro1_type, gcpro2_type, gcpro3_type, gcpro4_type, ungcpro_type 421 gcpro1_type, gcpro2_type, gcpro3_type, gcpro4_type, gcpro5_type,
422 ungcpro_type
422 } blocktype; 423 } blocktype;
423 424
424 struct block_input_history_struct 425 struct block_input_history_struct
425 { 426 {
426 char *file; 427 char *file;
429 int value; 430 int value;
430 }; 431 };
431 432
432 typedef struct block_input_history_struct block_input_history; 433 typedef struct block_input_history_struct block_input_history;
433 434
434 #endif 435 #endif /* DEBUG_INPUT_BLOCKING || DEBUG_GCPRO */
435 436
436 #ifdef DEBUG_INPUT_BLOCKING 437 #ifdef DEBUG_INPUT_BLOCKING
437 438
438 int blhistptr; 439 int blhistptr;
439 440
467 blhistptr++; 468 blhistptr++;
468 if (blhistptr >= BLHISTLIMIT) 469 if (blhistptr >= BLHISTLIMIT)
469 blhistptr = 0; 470 blhistptr = 0;
470 } 471 }
471 472
472 #endif 473 #endif /* DEBUG_INPUT_BLOCKING */
473 474
474 475
475 #ifdef DEBUG_GCPRO 476 #ifdef DEBUG_GCPRO
476 477
477 int gcprohistptr; 478 int gcprohistptr;
479 block_input_history gcprohist[GCPROHISTLIMIT]; 480 block_input_history gcprohist[GCPROHISTLIMIT];
480 481
481 static void 482 static void
482 log_gcpro (char *file, int line, struct gcpro *value, blocktype type) 483 log_gcpro (char *file, int line, struct gcpro *value, blocktype type)
483 { 484 {
484 FRAME start_frame;
485
486 if (type == ungcpro_type) 485 if (type == ungcpro_type)
487 { 486 {
488 if (value == gcprolist) goto OK; 487 if (value == gcprolist) goto OK;
489 if (! gcprolist) abort (); 488 if (! gcprolist) abort ();
490 if (value == gcprolist->next) goto OK; 489 if (value == gcprolist->next) goto OK;
567 { 566 {
568 log_gcpro (file, line, gcpro1, ungcpro_type); 567 log_gcpro (file, line, gcpro1, ungcpro_type);
569 gcprolist = gcpro1->next; 568 gcprolist = gcpro1->next;
570 } 569 }
571 570
571
572 /* To be called from the debugger */
573 void show_gcprohist (void);
572 void 574 void
573 show_gcprohist (void) 575 show_gcprohist (void)
574 { 576 {
575 int i, j; 577 int i, j;
576 for (i = 0, j = gcprohistptr; 578 for (i = 0, j = gcprohistptr;
589 gcprohist[j].value); 591 gcprohist[j].value);
590 } 592 }
591 fflush (stdout); 593 fflush (stdout);
592 } 594 }
593 595
594 #endif 596 #endif /* DEBUG_GCPRO */