Iterating over DSS

Dmitry Antipov dmantipov at
Thu Oct 27 02:15:46 PDT 2011


is there a method to iterate over DSS heap and find all used/free regions?
(I'm trying to see how much my DSS heap is fragmented). I.e. I would like to
do something like:

void *ptr;
size_t size;

ptr = dss_base;
fprintf(stderr, "DSS start: %p\n", ptr);

while (ptr < dss_prev) {
         if (ptr_is_a_pointer_to_allocated_block) { /* How to check this ? */
	        size = ivsalloc(ptr);
		fprintf(stderr, "used: %p..%p\n", ptr, ptr + size);
         } else
		ptr = (char *)ptr + sizeof (void *);

fprintf(stderr, "DSS end: %p\n", dss_prev);


More information about the jemalloc-discuss mailing list