--- alloc.c 2007-07-04 14:54:42.000000000 -0400 +++ alloc.c.smw 2007-07-10 20:54:56.000000000 -0400 @@ -547,7 +547,24 @@ RV(make_fixnum(tm->tm_nused)) )); } - + +DEFUN_NEW("TOTAL-BYTES-ALLOCATED",object,fStotal_bytes_allocated,SI,0,0,NONE,OO,OO,OO,OO,(void),"") +{int i,j; + bool counted; + long bytes = 0; + for(i=t_start; i < t_end; i++) { + counted = FALSE; + for(j=t_start; j < i; j++) + if (tm_table[i].tm_size == tm_table[j].tm_size) { + counted = TRUE; + break; + } + if (!counted) + bytes += tm_table[i].tm_size * tm_table[i].tm_nused; + } + RETURN1(make_fixnum(bytes)); +} + DEFUN_NEW("RESET-NUMBER-USED",object,fSreset_number_used,SI,0,1,NONE,OO,OO,OO,OO,(object typ),"") {int i; if (VFUN_NARGS == 1)