/*
* cacao/mm/lifespan.c
- * $Id: lifespan.c 110 1999-01-05 19:26:33Z phil $
+ * $Id: lifespan.c 115 1999-01-20 01:52:45Z phil $
*/
#include "mm.h"
memset(lifespan_objects, 0, heap_size);
}
-static __inline__ void lifespan_free_object(lifespan_object** o)
+static inline void lifespan_free_object(lifespan_object** o)
{
int size, high = 0;
/* file format: alloc time, size, lifespan */
int i;
for (i = 4; i < 32; ++i)
+#if 0
fprintf(stderr, "%Lu-%Lu\t%Lu\n",
(1LL << (i-1)),
(1LL << i) - 1,
lifespan_histo_size[i]);
+#else
+ fprintf(stderr, "%Lu\n",
+ lifespan_histo_size[i]);
+#endif
fprintf(stderr, "\n\n\n");
void lifespan_alloc(void* addr, unsigned long size)
{
+ int high = 0;
lifespan_object** object;
object = (lifespan_object**)((unsigned long)addr + (unsigned long)lifespan_objects_off);
(*object)->time = current_time;
(*object)->size = size;
(*object)->number = ++current_number;
+
+ while (size) {
+ ++high;
+ size = size >> 1;
+ }
+ ++lifespan_histo_size[high];
current_time += size;
}