Mercurial > hg > xemacs-beta
comparison src/alloc.c @ 3461:fd2936bbfc5f
[xemacs-hg @ 2006-06-19 18:10:17 by james]
Don't make the stats arrays bigger than they need to be.
<m3mzcdqbk5.fsf@jerrypc.cs.usu.edu>
author | james |
---|---|
date | Mon, 19 Jun 2006 18:10:19 +0000 |
parents | 721daee0fcd8 |
children | 8b1d806afbb3 |
comparison
equal
deleted
inserted
replaced
3460:7f34da25d871 | 3461:fd2936bbfc5f |
---|---|
506 static struct | 506 static struct |
507 { | 507 { |
508 int instances_in_use; | 508 int instances_in_use; |
509 int bytes_in_use; | 509 int bytes_in_use; |
510 int bytes_in_use_including_overhead; | 510 int bytes_in_use_including_overhead; |
511 } lrecord_stats [countof (lrecord_implementations_table) | 511 } lrecord_stats [countof (lrecord_implementations_table)]; |
512 + MODULE_DEFINABLE_TYPE_COUNT]; | |
513 | 512 |
514 void | 513 void |
515 init_lrecord_stats () | 514 init_lrecord_stats () |
516 { | 515 { |
517 xzero (lrecord_stats); | 516 xzero (lrecord_stats); |
552 int | 551 int |
553 lrecord_stats_heap_size (void) | 552 lrecord_stats_heap_size (void) |
554 { | 553 { |
555 int i; | 554 int i; |
556 int size = 0; | 555 int size = 0; |
557 for (i = 0; i < (countof (lrecord_implementations_table) | 556 for (i = 0; i < countof (lrecord_implementations_table); i++) |
558 + MODULE_DEFINABLE_TYPE_COUNT); i++) | |
559 size += lrecord_stats[i].bytes_in_use; | 557 size += lrecord_stats[i].bytes_in_use; |
560 return size; | 558 return size; |
561 } | 559 } |
562 #endif /* NEW_GC && ALLOC_TYPE_STATS */ | 560 #endif /* NEW_GC && ALLOC_TYPE_STATS */ |
563 | 561 |
3431 int instances_in_use; | 3429 int instances_in_use; |
3432 int bytes_in_use; | 3430 int bytes_in_use; |
3433 int instances_freed; | 3431 int instances_freed; |
3434 int bytes_freed; | 3432 int bytes_freed; |
3435 int instances_on_free_list; | 3433 int instances_on_free_list; |
3436 } lcrecord_stats [countof (lrecord_implementations_table) | 3434 } lcrecord_stats [countof (lrecord_implementations_table)]; |
3437 + MODULE_DEFINABLE_TYPE_COUNT]; | |
3438 | 3435 |
3439 static void | 3436 static void |
3440 tick_lcrecord_stats (const struct lrecord_header *h, int free_p) | 3437 tick_lcrecord_stats (const struct lrecord_header *h, int free_p) |
3441 { | 3438 { |
3442 int type_index = h->type; | 3439 int type_index = h->type; |
4426 int i; | 4423 int i; |
4427 EMACS_INT tgu_val = 0; | 4424 EMACS_INT tgu_val = 0; |
4428 | 4425 |
4429 #ifdef NEW_GC | 4426 #ifdef NEW_GC |
4430 | 4427 |
4431 for (i = 0; i < (countof (lrecord_implementations_table) | 4428 for (i = 0; i < countof (lrecord_implementations_table); i++) |
4432 + MODULE_DEFINABLE_TYPE_COUNT); i++) | |
4433 { | 4429 { |
4434 if (lrecord_stats[i].instances_in_use != 0) | 4430 if (lrecord_stats[i].instances_in_use != 0) |
4435 { | 4431 { |
4436 char buf [255]; | 4432 char buf [255]; |
4437 const char *name = lrecord_implementations_table[i]->name; | 4433 const char *name = lrecord_implementations_table[i]->name; |