small fixes in xseg-tool , filed
[archipelago] / xseg / xtypes / xobj.c
index 5154e11..6d96229 100644 (file)
@@ -43,6 +43,8 @@ int xobj_alloc_obj(struct xobject_h * obj_h, uint64_t nr)
        struct xheap *heap = XPTR_TAKE(obj_h->heap, container);
        struct xobject *obj = NULL;
 
+       unsigned long i = 0;
+
        uint64_t used, bytes = nr * obj_h->obj_size;
        xptr objptr;
        xhash_t *allocated = XPTR_TAKE(obj_h->allocated, container);
@@ -66,6 +68,8 @@ int xobj_alloc_obj(struct xobject_h * obj_h, uint64_t nr)
                obj->size = obj_h->obj_size;
                obj->next = XPTR_MAKE(((unsigned long) mem) + used, container); //point to the next obj
 //             printf("foo: %lx\n", &obj->next);
+               
+               i++;
 
 retry:
                r = xhash_insert(allocated, objptr, objptr); //keep track of allocated objects
@@ -91,6 +95,7 @@ retry:
                        goto retry;
                }
        }
+       XSEGLOG("allocated %lu elements\n", i);
        if (!obj)
                return -1;
        objptr = obj_h->list;